我试图了解如何计算回归树(及其整体对应物)的特征重要性。我正在查看compute_feature_importances
中函数/sklearn/tree/_tree.pyx
的源代码,并且不能完全遵循逻辑 - 并且没有引用。
对不起,这可能是一个非常基本的问题,但我找不到一个很好的文献参考,我希望有人可以指出我正确的方向,或快速解释代码,以便我可以继续挖掘。
由于
答案 0 :(得分:3)
引用位于文档而不是代码中:
`feature_importances_` : array of shape = [n_features]
The feature importances. The higher, the more important the
feature. The importance of a feature is computed as the (normalized)
total reduction of the criterion brought by that feature. It is also
known as the Gini importance [4]_.
.. [4] L. Breiman, and A. Cutler, "Random Forests",
http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm