hypopt
hypopt copied to clipboard
module 'sklearn.metrics' has no attribute 'scorer' with sklearn 0.23.0
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?
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.
@YUHENGLEEEEE thanks Steve, please submit a pull request?
are you going to update the package?
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 :)
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.