bqlearn.corruptions.noise_matrices.background_noise_matrix

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

Background noise matrix.

Parameters:
n_classesint

The number of classes.

noise_ratiofloat

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

dtypedata-type, default=None

Overrides the data type of the result.

random_stateint or RandomState, default=None

Controls the background class.

Returns:
matrixndarray of shape (n_classes, n_classes)

Returns the noise matrix.