What is the difference between from sklearn.model_selection import train_test_split and from sklearn.cross_validation import train_test_split

Viewed 2995

Can anyone help me? I am having hard time to know the difference between these

from sklearn.model_selection import train_test_split

from sklearn.cross_validation import train_test_split

In the documentation I saw it is written

"Split arrays or matrices into random train and test subsets"

for both of them.

Which should be used when??

1 Answers

sklearn.cross_validation.train_test_split is deprecated, you should use

from sklearn.model_selection import train_test_split

Related