bqlearn.corruptions.make_weak_labels

bqlearn.corruptions.make_weak_labels(X, y, estimator=None, *, train_size=0.1, stratify=None, discrete=True, random_state=None)[source]

Generate weak labels for a given dataset.

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

The samples.

yarray-like of shape (n_samples, )

The targets.

estimatorobject, default=None

The estimator used to generate weak labels. If None, LogisticRegression is used as the estimator.

train_sizefloat or int, default=0.1

If float, should be between 0.0 and 1.0 and represent the proportion of the dataset that the estimator will be fitted on. If int, represents the absolute number of samples that the estimator will be fitted on.

stratifyarray-like, default=None

If not None, data is split in a stratified fashion, using this as the class labels.

discreteboolean, default=True

Determines if corrupted labels are the predicted label or sampled from the predicted probability distribution. If False, estimator must support predict_proba.

random_stateint or RandomState, default=None

Controls the random_state of the estimator.

Returns:
y_corruptndarray of shape (n_samples, )

The untrusted targets as predicitions from the fitted estimator.