I am using python 2.7 in Ubuntu 14.04. I installed scikit-learn, numpy and matplotlib with these commands:
sudo apt-get install build-essential python-dev p
sklearn.cross_validation
has changed to
sklearn.model_selection
Checkout the documentation here: https://scikit-learn.org/stable/modules/cross_validation.html
train_test_split is now in model_selection. Just type:
from sklearn.model_selection import train_test_split
it should work
change the code like this
# from sklearn.cross_validation import train_test_split
from sklearn.model_selection import train_test_split
cross_validation was deprecated some time ago, try switching it out with model_selection
May be it's due to the deprecation of sklearn.cross_validation. Please replace sklearn.cross_validation with sklearn.model_selection
Ref- https://github.com/amueller/scipy_2015_sklearn_tutorial/issues/60
sklearn.cross_validation
is now changed to sklearn.model_selection
Just change
sklearn.cross_validation
to
sklearn.model_selection