python 特征选择特征工程

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 特征选择特征工程相关的知识,希望对你有一定的参考价值。

#下面的树算法(Tree algorithms)计算特征的信息量:
#输出每个特征的重要程度:
#[0.13784722  0.15383598  0.25451389  0.17476852  0.02847222  0.12314815  0.12741402]

from sklearn import metrics
from sklearn.ensemble import ExtraTreesClassifier
model = ExtraTreesClassifier()
model.fit(X, y)
# display the relative importance of each attribute
print(model.feature_importances_)

以上是关于python 特征选择特征工程的主要内容,如果未能解决你的问题,请参考以下文章