【发布时间】:2020-03-28 02:26:04
【问题描述】:
我目前正在做一个项目。我已经选择了我的功能并想检查它们的重要性。如果有人可以帮助我,我有一些问题。
1- 如果我使用RandomForestClassifier 和cross-validation 来计算特征重要性,是否有意义?
2- 我尝试使用cross_validate 函数计算特征重要性
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.cross_validate.html 。该函数提供 test_score 和 train_score 结果。我使用10 Fold cross-validation 得到的结果如下:
test_score [0.99950158, 0.9997231 , 0.9997231 , 0.99994462, 0.99977848, 0.99983386, 0.99977848, 0.9997231 , 0.99977847, 1.]
train_score [0.99998769, 0.99998154, 0.99997539, 0.99997539, 0.99998154,0.99997539, 0.99998154, 0.99997539, 0.99998154, 0.99997539],
谁能解释这些结果?它说明了什么?
3-cross_validate函数有一个名为scoring的参数,它有不同的评分值,例如accuracy、balanced_accuracy和f1。 scoring 参数有什么作用?这些值是什么意思?我应该如何决定选择哪一个?我已经阅读了 scikit-learn 文档,但我并不清楚。
谢谢。
【问题讨论】:
标签: python-3.x scikit-learn cross-validation feature-selection