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([[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) >>> scores = su_measure(X, y) >>> print(scores)