我正在使用scikit学习如何进行功能选择。这是我的密码
from sklearn.feature_selection import GenericUnivariateSelect
from sklearn.feature_selection import f_classif
scores = GenericUnivariateSelect(f_classif, 'k_best').fit(features_pd, target_pd)
如何使用f_classif
是一种CV方式,这样结果更可靠?在
Tags:
scikitlearn有一种递归的特征消除和交叉验证的选择方法,称为RFECV。以下代码仅供参考,与给定的示例on this link相似。在
样本输出:
参考链接:
编辑:使用变异数分析(ANOVA)进行特征选择
为了使用方差分析和交叉验证,您需要使用Pipeline、Select Percentile和{a9}。基于给定的示例here,您可以结合这些技术来使用CV+Annova测试进行特征选择。在
相关问题 更多 >
编程相关推荐