bqlearn.corruptions.make_sampling_biais¶
- bqlearn.corruptions.make_sampling_biais(X, *arrays, a=3, b=8, random_state=None)[source]¶
Synthetic covariate shift by creating a sampling biais using the first axis of a PCA learned of the input features [1].
- Parameters:
- Xarray-like of shape (n_samples, n_features)
The samples.
- *arrays: sequence of indexables with length / shape[0] equals to n_samples
Allowed inputs are lists, numpy arrays, scipy-sparse matrices or pandas dataframes.
- afloat, default = 3.0
- bfloat, default = 8.0
- random_stateint or RandomState, default=None
Controls the randomness of the PCA.
- Returns:
- X_corruptedndarray of shape (n_samples, n_features)
The corrupted samples.
- *arrays_imbalancedlist, length=len(arrays)
The corresponding imbalanced arrays.
References
[1]Gretton, Arthur, et al. “Covariate shift by kernel mean matching.” Dataset shift in machine learning 3.4 (2009): 5.