bqlearn.corruptions.noise_matrices.flip_noise_matrix

bqlearn.corruptions.noise_matrices.flip_noise_matrix(n_classes, noise_ratio, permutation=False, dtype=<class 'float'>, random_state=None)[source]

Flip noise matrix.

Parameters:
n_classesint

The number of classes.

noise_ratiofloat

The ratio of noise. Must be between 0 and 1.

permutationboolean, default=False

If True, construct a permutation matrix, such that two different classes can’t flip to the same noisy class.

dtypedata-type, default=None

Overrides the data type of the result.

random_stateint or RandomState, default=None

Controls the flip direction.

Returns:
matrixndarray of shape (n_classes, n_classes)

Returns the noise matrix.