ImportError: No module named grid_search, learning_curve

Andy Hui picture Andy Hui · Jan 31, 2019 · Viewed 24.4k times · Source

Problem with Scikit learn l can't use learning_curve of Sklearn and sklearn.grid_search.

When l do import sklearn (it works) from sklearn.cluster import bicluster (it works). i try to reinstall scikit-learn also remain the same issue. I am using python 3.5.6, Scikit-learn version 0.20.0 Window 10.

 import sklearn
 from sklearn.model_selection import StratifiedKFold, cross_val_score, 
 train_test_split 
 from sklearn.grid_search import GridSearchCV
 from sklearn.learning_curve import learning_curve

Answer

seralouk picture seralouk · Jan 31, 2019

In the new version these are in the model_selection module.

Use this:

from sklearn.model_selection import learning_curve, GridSearchCV