随机森林分类器:预测概率的特征重要性
Random Forest Classifier: feature importance of prediction probability
我正在使用 sklearn RFC。
forest.fit(training_data, y_train)
probas_test = forest.predict_proba(test_data)
我想知道有没有办法找到导致预测的每个特征的贡献/重要性。
类似于 ,但针对单个数据点级别。
forest.feature_importances_
这可以通过多种方式解决;检查 http://blog.datadive.net/interpreting-random-forests/ (and a Python package for that: https://github.com/andosa/treeinterpreter)。还有较少的直接选项,例如
- https://arxiv.org/abs/1606.05390 (implementation: https://github.com/sato9hara/defragTrees)
- https://arxiv.org/abs/1611.05722 (implementation: https://github.com/IBCNServices/GENESIM)
我正在使用 sklearn RFC。
forest.fit(training_data, y_train)
probas_test = forest.predict_proba(test_data)
我想知道有没有办法找到导致预测的每个特征的贡献/重要性。
类似于 ,但针对单个数据点级别。
forest.feature_importances_
这可以通过多种方式解决;检查 http://blog.datadive.net/interpreting-random-forests/ (and a Python package for that: https://github.com/andosa/treeinterpreter)。还有较少的直接选项,例如
- https://arxiv.org/abs/1606.05390 (implementation: https://github.com/sato9hara/defragTrees)
- https://arxiv.org/abs/1611.05722 (implementation: https://github.com/IBCNServices/GENESIM)