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_permutation breaks #526

Closed
r0f1 opened this issue May 8, 2019 · 1 comment · Fixed by #528
Closed

feature_importance_permutation breaks #526

r0f1 opened this issue May 8, 2019 · 1 comment · Fixed by #528
Labels

Comments

@r0f1
Copy link

r0f1 commented May 8, 2019

Hi,
The following does not work:

from sklearn.metric import mean_squared_error
feature_importance_permutation(..., metric=mean_squared_error)

Error:

UnboundLocalError: local variable 'score_func' referenced before assignment

Looking at the code, it does make sense. Metric should be either of the two options documented. Contrary, to what is documented however, passing a function DOES NOT work.

Please make the feature_importance_permutation() work with arbitrary scoring functions or update the documentation.

Thank you!

@rasbt
Copy link
Owner

rasbt commented May 8, 2019

Good catch, not sure how this slipped through ... It's definitely a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants