特征选择过滤器 - f_classif(计算提样本的ANOVA F值)

官网:sklearn.feature_selection.f_classif
关于 f_classif 的数学知识参考:Sklearn中的f_classif和f_regression

sklearn.feature_selection.f_classif(X,y )

计算提供的样本的ANOVA(方差分析) F值。

参数说明

Parameters
----------
X:{array-like, sparse matrix} shape = [n_samples, n_features]
   The set of regressors that will be tested sequentially.
   将依次测试的一组回归变量。

y:array of shape(n_samples)
   The data matrix.
   数据矩阵。

Returns
-------
F:array, shape = [n_features,]
The set of F values.

pva:larray, shape = [n_features,]
The set of p-values.

示例

from sklearn import feature_selection as FS

fv, pv = FS.f_classif(X, y)

你可能感兴趣的:(机器学习,python)