ImportError No module named sklearn cross validation

0 votes

 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 python-numpy \
python-numpy-dev python-scipy libatlas-dev g++ python-matplotlib \
ipython

But when I import these packages:

from sklearn.cross_validation import train_test_split

It returns me this error:

ImportError: No module named sklearn.cross_validation


Could anyone help in this?

Dec 16, 2020 in Python by Gitika
• 65,910 points
2,865 views

1 answer to this question.

0 votes

Regarding your query, it must relate to the renaming and deprecation of the cross_validation sub-module to model_selection. You can try substituting cross_validation to model_selection.

answered Dec 16, 2020 by Nikita

Related Questions In Python

0 votes
1 answer

ImportError: No module named requests

Requests is not available for use by ...READ MORE

answered Jun 26, 2018 in Python by Hamartia's Mask
• 1,580 points
2,259 views
+3 votes
1 answer

Tensorflow 1.5 ImportError: No module named tensorflow.python.client

I think it's a bug in Tensorflow ...READ MORE

answered Sep 25, 2018 in Python by charlie_brown
• 7,720 points
6,579 views
0 votes
1 answer

tensorflow 1.5 ImportError: No module named tensorflow.python.client

Some of the modules have changed in ...READ MORE

answered Oct 5, 2018 in Python by Priyaj
• 58,090 points
2,470 views
0 votes
1 answer

Python error "ImportError: No module named pygame.locals"

You need to download and install the ...READ MORE

answered Jun 18, 2019 in Python by Greg
6,216 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,056 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
3,476 views
0 votes
3 answers

import NumPy as np ImportError: No module named NumPy

You need to install numpy using pip install ...READ MORE

answered Dec 16, 2020 in Python by Roshni
• 10,520 points
35,121 views
+2 votes
3 answers

ModuleNotFoundError: No module named 'Crypto'

The module you’ve installed is different. To install ...READ MORE

answered Aug 20, 2019 in Python by Raman
77,405 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP