“No module named 'sklearn.cross_validation'” Code Answer’s

It should be about renaming and putting down of cross_validation sub-module into model_selection.

While writing a python code and moving from sklearn.cross_validation, there was reported an error:
ModuleNotFoundError: No module named'sklearn.cross_validation.

You often face this problem during import classes from the cross_validation module in place of the model_selection module.

ModuleNotFoundError: No module named 'sklearn.cross_validation'

on Jan 01, 1970
#train_test_split is now in model_selection. Just type:

from sklearn.model_selection import train_test_split
#it should work

Add Comment

0

ModuleNotFoundError: No module named 'sklearn.cross_validation'

on Jan 01, 1970
Substitute cross_validation to model_selection

Add Comment

0

No module named 'sklearn.cross_validation'

on Jan 01, 1970
#Substitute cross_validation to model_selection
from sklearn.model_selection import train_test_split

Add Comment

0

ModuleNotFoundError: No module named 'sklearn.cross_validation' site:stackoverflow.com

on Jan 01, 1970
importing new sklearn(train_test_split)

Add Comment

0

To solve this problem use Model_selection in place of cross_validation.

The cross_validation was detested in the design of 0.18 and was changed to model_selection in the design of 0.20.

So we should use model selection instead of cross selection.

You can use it to active, sklearn.model_selection import train_test_split

That's it.

Python answers related to "no module named sklearn cross_validation"

View All Python queries

Python queries related to "no module named sklearn cross_validation"

Browse Other Code Languages

CodeProZone