ITMO_FS.filters.univariate.f_ratio_measure¶
-
ITMO_FS.filters.univariate.f_ratio_measure(x, y)¶ Calculate Fisher score for features. Bigger values mean more important features.
Parameters: - x (array-like, shape (n_samples, n_features)) – The training input samples.
- y (array-like, shape (n_samples,)) – The target values.
Returns: array-like, shape (n_features,)
Return type: feature scores
See also
https()- //papers.nips.cc/paper/2909-laplacian-score-for-feature-selection.pdf
Examples
>>> from ITMO_FS.filters.univariate import f_ratio_measure >>> import numpy as np >>> 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]) >>> f_ratio_measure(x, y) array([0.6 , 0.2 , 1. , 0.12, 5.4 ])