bqlearn.corruptions.make_feature_dependent_label_noise

bqlearn.corruptions.make_feature_dependent_label_noise(X, y, *, noise_ratio=0.5, random_state=None, labels=None)[source]

Corrupt the labels using a noise distribution model by a random linear projection from the features to the labels [1].

Parameters:
Xarray-like of shape (n_samples, n_features)

The samples.

yarray-like of shape (n_samples, )

The targets.

noise_ratiofloat, default=0.5

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

random_stateint or RandomState, default=None

Controls the noise matrix construction.

labelsarray-like of shape (n_classes), default=None

List of labels to index the matrix. This may be used to reorder or select a subset of labels. If None is given, those that appear at least once in y and are used in sorted order.

Returns:
y_corruptndarray of shape (n_samples,)

The corrupted targets.

References

[1]

Xia, X., Liu, T., Han, B., Wang, N., Gong, M., Liu, H., Sugiyama, M., “Part-dependent label noise: Towards instance-dependent label noise”, NeurIPS 2020.