1

I am running scikit-learn 0.24.2 on the intelpython3_full conda distribution. I am trying to run:

from sklearn.model_selection import HalvingGridSearchCV

and get the following error:

ImportError: cannot import name 'HalvingGridSearchCV' from 'sklearn.model_selection'

I am trying to run it from jupyter notebook.

Already tried reinstalling scikit-learn:

conda uninstall scikit-learn
conda install scikit-learn -c intel 

Also tried:

-c conda-forge

Always get this error. Other imports with sklearn, for instance GridSearchCV work. Can someone help me with this?

1 Answer 1

12

This must be run first:

from sklearn.experimental import enable_halving_search_cv 

and then this:

from sklearn.model_selection import HalvingGridSearchCV

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.