cardinal.random

Classes

class cardinal.random.RandomSampler(batch_size: int, random_state: Optional[Union[RandomState, int]] = None)[source]

Randomly select samples

Parameters
  • batch_size – Number of samples to select.

  • random_state – The seed of the pseudo random number generator to use when shuffling the data. If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None (defdault), the random number generator is the RandomState instance used by np.random.

random_state

The random state used by the sampler.

fit(X: Optional[array] = None, y: Optional[array] = None) RandomSampler[source]

Sets the random state

Parameters
  • X – Labeled samples of shape (n_samples, n_features).

  • y – Labels of shape (n_samples).

Returns

The object itself

score_samples(X: array) array[source]

Give an informativeness score to unlabeled samples.

Parameters

X – Samples to evaluate.

Returns

Scores of the samples.