ITMO_FS.filters.univariate.su_measure

ITMO_FS.filters.univariate.su_measure(X, y)

SU is a correlation measure between the features and the class calculated, via formula SU(X,Y) = 2 * I(X|Y) / (H(X) + H(Y))

Parameters:
  • X (numpy array, shape (n_samples, n_features)) – The input samples.
  • y (numpy array, shape (n_samples, )) – The classes for the samples.
Returns:

Return type:

Score for each feature as a numpy array, shape (n_features, )

See also

https()
//www.matec-conferences.org/articles/matecconf/pdf/2016/05/matecconf_iccma2016_06002.pdf

Examples

>>> import sklearn.datasets as datasets
>>> from ITMO_FS.filters.univariate import su_measure
>>> X = np.array([[3, 3, 3, 2, 2], [3, 3, 1, 2, 3], [1, 3, 5, 1, 1], [3, 1, 4, 3, 1], [3, 1, 2, 3, 1]])
>>> y = np.array([1, 3, 2, 1, 2])
>>> scores = su_measure(X, y)
>>> print(scores)