DiscreteRandomSmoother
- class scikit_weak.utils.DiscreteRandomSmoother(p_err=0.1, p_incl=1.0, prob_ranges=None, type='set', samples=100, epsilon=0.0)
A class to transform a supervised learning problem into a weakly supervised one, based on random sampling. It currently supports transformation to superset and fuzzy label learning. Note that DiscreteRandomSmoother does not implement the transform method: therefore, usage should be based on calling fit_transform.
- Parameters
p_err (float, default=0.1) – The probability to include any single wrong label in a sample draw. Should be between 0 and 1.
p_incl (float, default=1.0) – The probability to include the correct label in a sample draw. Should be between 0 and 1.
prob_ranges (enumerable of float, default=None) – Array of possible membership degrees to be sampled. If not None, overrides both p_err and p_incl
type ({'set', 'fuzzy'}, default=set) – Type of weakly supervised labels to transform into
samples (int, default=100) – Number of samples to be generated
epsilon (float, default=1.0) – Parameter to select the minimum allowed label degree. Only used when type == ‘set’. Should be between 0 and 1
- Variables
n_classes (int) – The number of unique classes in y
- fit_transform(X, y)
Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
- Xarray-like of shape (n_samples, n_features)
Input samples.
- yarray-like of shape (n_samples,) or (n_samples, n_outputs), default=None
Target values (None for unsupervised transformations).
- **fit_paramsdict
Additional fit parameters.
- X_newndarray array of shape (n_samples, n_features_new)
Transformed array.