Skip to content

ENH Remove useless operation in feature_importance_ - #13155

Merged
qinhanmin2014 merged 1 commit into
scikit-learn:masterfrom
mgaido91:tree_feature_importance
Feb 13, 2019
Merged

qinhanmin2014 merged 1 commit into
scikit-learn:masterfrom
mgaido91:tree_feature_importance

Conversation

@mgaido91

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

In #11176 the feature improtance computation was fixed, but a useless computation was left. The importance vector elements are first divided by a constant and then scaled over their sum. The first division is, hence, useless.

What does this implement/fix? Explain your changes.

The PR removes the useless division performed in feature important computation. This division is made meaningless by the subsequent re-scaling over the sum of all the entries of the importance vector.

Any other comments?

cc @ahmadia @gforsyth @glemaitre @jnothman @ogrisel who worked on that PR.

@qinhanmin2014 qinhanmin2014 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @mgaido91

@qinhanmin2014
qinhanmin2014 merged commit 89f5488 into scikit-learn:master Feb 13, 2019
@mgaido91

Copy link
Copy Markdown
Contributor Author

thanks @jnothman @qinhanmin2014!

xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants