ITMO_FS.filters.multivariate.FCBFDiscreteFilter

class ITMO_FS.filters.multivariate.FCBFDiscreteFilter

Creates FCBF (Fast Correlation Based filter) feature selection filter based on mutual information criteria for data with discrete features This filter finds best set of features by searching for a feature, which provides the most information about classification problem on given dataset at each step and then eliminating features which are less relevant than redundant

Notes

For more details see this paper.

Examples

>>> from ITMO_FS.filters.multivariate import FCBFDiscreteFilter
>>> 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]], dtype = np.integer)
>>> y = np.array([1, 2, 3, 4, 5], dtype=np.integer)
>>> fcbf = FCBFDiscreteFilter()
>>> print(fcbf.fit_transform(X, y))
__init__()

Initialize self. See help(type(self)) for accurate signature.

fit(X, y, feature_names=None)

Fits filter

Parameters:
  • X (array-like, shape (n_samples, n_features)) – 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:

None

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