You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rewrite user-guide to clarify feature_importances_ are impurity based #14528
We recently added permutation importance, which is a nice alternative to the impurity based feature_importances_ provided by trees.
Whenever we're talking about feature importances in the user guide, we should make sure that we explain that the feature_importances_ attribute refers to impurity based importance.
Where applicable, we should consider replacing its usage by permutation_importance or compare the two.
@amueller Hey! I would also like to work on this issue but I am having trouble starting. I have a basic understanding of scikit-learn. What topics should I read to learn about feature_importances_ ?
I have also added some notes about where to update the doc: #16023 (comment) so as to emphasize that impurity based feature importances can be misleading while permutation-based feature importances are both model agnostic and robust to the cardinality biais.
I reopened this because I think we should still consider updating the examples to favor permutation_importance instead or at least compare the two methods each time.
The last two examples already compare with permutation_importance: nothing to do.
The remaining 3 examples would benefit from comparing impurity-based feature importances with the result of permutation_importance when the latter is not to costly (execution lasts less than 30s to compute on a regular laptop).
In particular if computing permutation_importance in plot_forest_importances_faces.py is too compute intensive, we can keep it that way and just add a link to the user guide. The syntax to add a restructured text reference to the relevant section in the user guide is:
:ref:`permutation_importance`
Feel free to open a PR for each of them so that we can review and merge them independently of one another.
Activity
MatthewBosek commentedon Jul 31, 2019
@amueller Hey! I am new to scikit, open source development, and development in general. Would this be a good issue for me to work on?
shahules786 commentedon Jul 31, 2019
@amueller I have send a PR,please check.
b1naryher0 commentedon Aug 4, 2019
@amueller Hey! I would also like to work on this issue but I am having trouble starting. I have a basic understanding of scikit-learn. What topics should I read to learn about feature_importances_ ?
hncatanese commentedon Oct 24, 2019
I am going to see if I can make progress on this issue.
ogrisel commentedon Jan 15, 2020
I have also added some notes about where to update the doc: #16023 (comment) so as to emphasize that impurity based feature importances can be misleading while permutation-based feature importances are both model agnostic and robust to the cardinality biais.
Basically we need to cross-reference the two methods and link to the example that compares them.
ogrisel commentedon Jan 15, 2020
Here are some background references and discussion on impurity based feature importances:
https://stackoverflow.com/a/15821880/163740
ogrisel commentedon Feb 4, 2020
I reopened this because I think we should still consider updating the examples to favor
permutation_importanceinstead or at least compare the two methods each time.nilichen commentedon Mar 19, 2020
take
ogrisel commentedon Mar 19, 2020
@nilichen here is the list of examples that mention
feature_importances_:The last two examples already compare with
permutation_importance: nothing to do.The remaining 3 examples would benefit from comparing impurity-based feature importances with the result of
permutation_importancewhen the latter is not to costly (execution lasts less than 30s to compute on a regular laptop).In particular if computing
permutation_importanceinplot_forest_importances_faces.pyis too compute intensive, we can keep it that way and just add a link to the user guide. The syntax to add a restructured text reference to the relevant section in the user guide is:Feel free to open a PR for each of them so that we can review and merge them independently of one another.
nilichen commentedon Mar 19, 2020
Sounds good. That's extremely helpful. Thanks!
azihna commentedon Feb 6, 2021
We are working examples/ensemble/plot_forest_importances.py with @temmyzeus
azihna commentedon Feb 9, 2021
I'll also work on
examples/ensemble/plot_forest_importances_faces.pynow that the other one is merged.