ITMO_FS.filters.multivariate.DISRWithMassive¶
-
class
ITMO_FS.filters.multivariate.DISRWithMassive(n_features)¶ Create DISR (Double Input Symmetric Relevance) feature selection filter based on kASSI criterin for feature selection which aims at maximizing the mutual information avoiding, meanwhile, large multivariate density estimation. Its a kASSI criterion with approximation of the information of a set of variables by counting average information of subset on combination of two features. This formulation thus deals with feature complementarity up to order two by preserving the same computational complexity of the MRMR and CMIM criteria The DISR calculation is done using graph based solution.
Parameters: n_features (int) – Number of features to select. Notes
For more details see this paper.
Examples
>>> from ITMO_FS.filters.multivariate import DISRWithMassive >>> import numpy as np >>> X = np.array([[1, 2, 3, 3, 1], [2, 2, 3, 3, 2], [1, 3, 3, 1, 3], ... [3, 1, 3, 1, 4], [4, 4, 3, 1, 5]]) >>> y = np.array([1, 2, 3, 4, 5]) >>> disr = DISRWithMassive(3).fit(X, y) >>> disr.selected_features_ array([0, 1, 4], dtype=int64)
-
__init__(n_features)¶ Initialize self. See help(type(self)) for accurate signature.
-
fit(X, y=None, **fit_params)¶ Fit the algorithm.
Parameters: - X (array-like, shape (n_samples, n_features)) – The training input samples.
- y (array-like, shape (n_samples,), optional) – The class labels.
- fit_params (dict, optional) – Additional parameters to pass to underlying _fit function.
Returns: Return type: Self, i.e. the transformer object.
-
fit_transform(X, y=None, **fit_params)¶ Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
Parameters: - X ({array-like, sparse matrix, dataframe} of shape (n_samples, n_features)) –
- y (ndarray of shape (n_samples,), default=None) – Target values.
- **fit_params (dict) – Additional fit parameters.
Returns: X_new – Transformed array.
Return type: ndarray array of shape (n_samples, n_features_new)
-
get_params(deep=True)¶ Get parameters for this estimator.
Parameters: deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns: params – Parameter names mapped to their values. Return type: mapping of string to any
-
set_params(**params)¶ Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>so that it’s possible to update each component of a nested object.Parameters: **params (dict) – Estimator parameters. Returns: self – Estimator instance. Return type: object
-
transform(X)¶ Transform given data by slicing it with selected features.
Parameters: X (array-like, shape (n_samples, n_features)) – The training input samples. Returns: Return type: Transformed 2D numpy array
-