ModuleNotFoundError: No module named 'sklearn.cross_validation'

created at 06-24-2021 views: 2

Error call method: 

Correct call:

from sklearn.model_selection import train_test_split

In machine learning, we usually divide the original data into the "Test Set" and "Training Set" according to the proportion, often use the train_test_split module in sklearn.cross_validation to split the data.

But now, the train_test_split has been discarded by cross_validation.

So you may get an error:

ModuleNotFoundError: No module named 'sklearn.cross_validation'

This issue can now be called from sklearn.model_selection to call the train_test_split function.

Please log in to leave a comment.