Answers for "ImportError: cannot import name 'cross_validation' from 'sklearn"

2

ModuleNotFoundError: No module named 'sklearn.cross_validation'

#train_test_split is now in model_selection. Just type:

from sklearn.model_selection import train_test_split
#it should work
Posted by: Guest on April-25-2021
14

ModuleNotFoundError: No module named 'sklearn.cross_validation'

Substitute cross_validation to model_selection
Posted by: Guest on May-17-2020

Code answers related to "ImportError: cannot import name 'cross_validation' from 'sklearn"

Python Answers by Framework

Browse Popular Code Answers by Language