特徵選擇過濾器 - 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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章