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

module 'sklearn.metrics' has no attribute 'scorer' with sklearn 0.23.0 #20

Open
fcoppey opened this issue May 19, 2020 · 5 comments
Open

Comments

@fcoppey
Copy link

fcoppey commented May 19, 2020

I just updated sklearn to 0.23.0 and now hypopt .fit() function raises this error where using scoring='accuracy' with sklearn LocalOutlierFactor():
/usr/local/lib/python3.7/site-packages/hypopt/model_selection.py:174: UserWarning: ERROR in thread<NoDaemonProcess(NoDaemonPoolWorker-2, started)>with exception:
module 'sklearn.metrics' has no attribute 'scorer'.
Any compatibility issues with latest sklearn?

@YUHENGLEEEEE
Copy link

scorer becomes a private API in newer version of sklearn. One fix to this is to change those metrics.scorer to metrics._scorer in the model_selection.py.

@cgnorthcutt
Copy link
Owner

@YUHENGLEEEEE thanks Steve, please submit a pull request?

@fcoppey
Copy link
Author

fcoppey commented Jun 12, 2020

are you going to update the package?

@AlessandroMiola
Copy link
Contributor

AlessandroMiola commented Dec 6, 2020

Hi all, I see that there is an issue with latest versions of sklearn (>=0.22.X) and that scorer has become a private API starting from version 0.22. Anyway, since here the problem was raised with parameter scoring='accuracy' I can't see how this is related to the solution which was specified above.

Can anyone help? Thank you :)

@AlessandroMiola
Copy link
Contributor

Hi all, I have eventually figured the issue out. The solution specified above is indeed the correct one.

My feeling was that, with non-custom scoring parameters, the fact that sklearn.metrics.scorer is no more existent (as replaced by sklearn.metrics._scorer) could have been circumvented. I was wrong as an exception is thrown before the else-clause responsible for the computation of scores with non-custom scoring parameters can be even reached.

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

4 participants