Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature importance should be normalised. #27

Closed
cmacdonald opened this issue Jul 21, 2019 · 2 comments
Closed

feature importance should be normalised. #27

cmacdonald opened this issue Jul 21, 2019 · 2 comments

Comments

@cmacdonald
Copy link
Contributor

It is customary to normalise them to be 100 max. See Hastie et al. pg 368:
https://web.stanford.edu/~hastie/Papers/ESLII.pdf

I used

100*feature_analysis.T[:,0]/np.max(feature_analysis.T[:,0])
@strani strani closed this as completed in df83f78 Jul 22, 2019
@strani
Copy link
Contributor

strani commented Jul 22, 2019

I ended up adding a normalize parameter, which is True by default, that normalizes the given importances in the range [0,1]. I preferred that way instead of multiplying the values by 100 (supposed to be a percentage). Obtaining the 100 based value is however straightforward.

P.S. LightGBM and XGBoost do not normalize feature importance, according to the documentation.

@cmacdonald
Copy link
Contributor Author

@strani I think the normalisation as an option is a good idea. I find the numbers much more interpretable in normalised form.

Craig

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

No branches or pull requests

2 participants