ImportError: cannot import name 'cross_validation'
ModuleNotFoundError: No module named 'sklearn.learning_curve'
ModuleNotFoundError: No module named 'sklearn.grid_search'
在0.18以上的sklearn版本中,以上这些库全部都没掉了,都在model_selection下面
所以以上库都应该该为从sklearn.model_selection导入
代码如下:
from sklearn import cross_validation
改为
from sklearn import model_selection
from sklearn.learning_curve import learning_curve
改为
from sklearn.model_selection import learning_curve
from sklearn.grid_search import GridSearchCV
改为
from sklearn.model_selection import GridSearchCV