ITMO_FS.filters.multivariate
.TraceRatioFisher¶
-
class
ITMO_FS.filters.multivariate.
TraceRatioFisher
(n_selected_features)¶ Creates TraceRatio(similarity based) feature selection filter performed in supervised way, i.e fisher version
Parameters: n_selected_features (int) – Amount of features to filter Notes
For more details see this paper.
Examples
>>> from ITMO_FS.filters.multivariate import TraceRatioFisher >>> from sklearn.datasets import make_classification >>> x, y = make_classification(1000, 100, n_informative = 10,n_redundant = 30, n_repeated = 10, shuffle = False) >>> tracer = TraceRatioFisher(10) >>> print(tracer.fit_transform(x, y))
-
__init__
(n_selected_features)¶ Initialize self. See help(type(self)) for accurate signature.
-
fit
(X, y, feature_names=None)¶ Fits filter
Parameters: - X (numpy array, shape (n_samples, n_features)) – The training input samples
- y (numpy array, shape (n_samples, )) – The target values
- feature_names (list of strings, optional) – In case you want to define feature names
Returns: Return type: None
Examples
-
fit_transform
(X, y, feature_names=None)¶ Fits the filter and transforms given dataset X.
Parameters: - X (array-like, shape (n_features, n_samples)) – The training input samples.
- y (array-like, shape (n_samples, )) – The target values.
- feature_names (list of strings, optional) – In case you want to define feature names
Returns: Return type: X dataset sliced with features selected by the filter
-
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
-