ImportError: No module named sklearn.cross_validation ImportError: No module named sklearn.cross_validation python python

ImportError: No module named sklearn.cross_validation


It must relate to the renaming and deprecation of cross_validation sub-module to model_selection. Try substituting cross_validation to model_selection


train_test_split is now in model_selection. Just type:

from sklearn.model_selection import train_test_split

it should work


I guess cross selection is not active anymore. We should use instead model selection. You can write it to run, from sklearn.model_selection import train_test_split

Thats it.