ImportError: cannot import name 'enable_halving_search_cv' from 'sklearn.experimental' (C:\Users\Administrator\anaconda3\lib\site-packages\sklearn\experimental\__init__.py)
See original GitHub issueDescribe the bug
Cannot import enable_halving_search_cv
from sklearn as documented in sklearn manual.
Steps/Code to Reproduce
Example:
from sklearn.experimental import enable_halving_search_cv
from sklearn.model_selection import HalvingRandomSearchCV
Actual Results
ImportError: cannot import name 'enable_halving_search_cv' from 'sklearn.experimental' (C:\Users\Administrator\anaconda3\lib\site-packages\sklearn\experimental\__init__.py)
Versions
System: python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] executable: C:\Users\Administrator\anaconda3\python.exe machine: Windows-10-10.0.18362-SP0
Python dependencies: pip: 20.2.4 setuptools: 50.3.1.post20201107 sklearn: 0.23.2 numpy: 1.19.2 scipy: 1.5.2 Cython: 0.29.21 pandas: 1.1.3 matplotlib: 3.3.2 joblib: 0.17.0 threadpoolctl: 2.1.0
Built with OpenMP: True
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
ImportError: cannot import name 'HalvingGridSearchCV' from ...
This must be run first: from sklearn.experimental import enable_halving_search_cv. and then this: from sklearn.model_selection import ...
Read more >sklearn.model_selection.HalvingRandomSearchCV
In this case, min_resources cannot be 'exhaust'. factorint or float, default=3. The 'halving' parameter, which determines the proportion of candidates that are ...
Read more >Fix ModuleNotFoundError: No module named 'sklearn'
This error indicates that the scikit-learn (aka sklearn ) package was not installed, or even if it was installed for some reason it...
Read more >How to Fix : “ImportError: Cannot import name X” in Python?
You can solve the “ ImportError : Cannot import name X” Error by resolving the circular dependencies. You can do that either by...
Read more >ImportError cannot import name LinearRegression from sklearn
I installed this model but I am getting this below error. from sklearn import LinearRegression ImportError: cannot import name 'LinearRegression ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mridunanda Make sure you have this line before importing. That was the issue for me.
from sklearn.experimental import enable_halving_search_cv
You need to update scikit-learn 0.24 using
pip
or conda-forge.