DELIN

class scikit_weak.feature_selection.DELIN(k=3, d=2, n_iters=10)

A class to perform classification and dimensionality reduction for weakly supervised data, based on the DELIN algorithm [1]. The original method has been slighlty modified by using SVD in the computation of the inverse, so as to avoid issues when the data matrix is singular. The y input to the fit method should be given as an iterable of DiscreteWeakLabel

Parameters
  • k (int, default=3) – The number of neighbors

  • d – The number of dimensions to be kept after reduction. If int, then the exact number of features to be kept.

If float, the percentage of the total number of dimensions. :type d: int or float, default = 2

Parameters

iters (int, default = 10) – The number of iterations to be performed

Variables
  • y (ndarray) – If y is in prob format, then target is a copy of y. Otherwise it is y in prob format

  • clf (WeaklyKNeighborsClassifier object) – A WeaklyKNeighborsClassifier classifier to be used during fitting of the algorithm

  • vr (ndarray) – A square ndarray with the same dim as X.shape[1]. Used to perform dimensionality reduction

  • n_classes (int) – The number of unique classes in y

  • classes (ndarray) – The unique classes in y

fit(X, y)

Fit the DELIN model

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.

predict(X)

Returns predictions for the given X

predict_proba(X)

Returns probability distributions for the given X

References

[1] Wu, J. H., & Zhang, M. L. (2019).

Disambiguation enabled linear discriminant analysis for partial label dimensionality reduction. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD ‘19), 416-424. https://doi.org/10.1145/3292500.3330901