rsteca / sklearn-deap

Use evolutionary algorithms instead of gridsearch in scikit-learn
MIT License
771 stars 131 forks source link

Problem with scikit 0.24 #71

Closed cif2cif closed 3 years ago

cif2cif commented 3 years ago

There is a problem with the version 0.24 of scikit: No module named 'sklearn.metrics.scorer'

wangyexiang commented 3 years ago

There is a problem with the version 0.24 of scikit: No module named 'sklearn.metrics.scorer'

Dear sir, do you solve this issue?@cif2cif

zhou89317 commented 3 years ago

There is a problem with the version 0.24 of scikit: No module named 'sklearn.metrics.scorer'

I‘m having the same issue. But I tried to uninstall sklearn 0.24 and install an older version, still get the same error’

anselmo-parnada commented 3 years ago

The issue arises because the check_scoring function has moved from sklearn.metrics.scorer.check_scoring to sklearn.metrics.check_scoring in the most recent version of scikit learn (ref).

I fixed the issue manually by going into the library's cv.py file which can be accessed via the following path:

C:\_<project directory>_\venv\Lib\site-packages\evolutionary_search\cv.py

Note: If you use an Anaconda environment or your base system environment, the path will be different.

Then in that file, change line 13 from:

from sklearn.metrics.scorer import check_scoring

to

from sklearn.metrics import check_scoring

Then that should fix the issue 👍

rsteca commented 3 years ago

Hey @anselmo-parnada thanks for checking this! I will commit a fix when I have some time

rsteca commented 3 years ago

Issue is solved in sklearn-deap==0.3.0