sklearn.cross_validation import train_test_split not working

0 votes

While on splitting test data set the command mentioned crossvalidation is not working:

from sklearn.cross_validation import train_test_split

It is saying no such module error although I have installed scikit learn via 

conda install -c anaconda scikit-learn

but the below import works fine

from sklearn.model_selection import train_test_split

Why is the initial import not working even though I have done everything??

Jul 25 in Python by Firoz
159 views

1 answer to this question.

0 votes

cross_validation is not a part of sklearn package anymore. It is in the new version of scikit-learn. That's why you are getting the error.

answered Jul 25 by Sharan

Related Questions In Python

0 votes
1 answer

Raw_input method is not working in python3. How to use it?

raw_input is not supported anymore in python3. ...READ MORE

answered May 4, 2018 in Python by aayushi
• 750 points
135 views
0 votes
1 answer

Global Send Keys - Input text which has '(' is not working

Global Send Keys internally uses System.Windows.Forms.SendKeys so special characters escaped. For more ...READ MORE

answered Nov 15, 2018 in Python by findingbugs
• 3,170 points
425 views
0 votes
1 answer

Not able to Import scikitplot package in my Jupyter Lab

To overcome this issue, you need to ...READ MORE

answered Feb 21 in Python by Yami
667 views
0 votes
0 answers

try except is not working while using hdfs command

Hi,  I am trying to run following things ...READ MORE

Mar 6 in Python by anonymous
45 views
+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 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 278 views
+4 votes
6 answers
0 votes
1 answer

how can i import the tensorflow library in python?

to import the tensorflow library in your ...READ MORE

answered May 20 in Python by Mohammad
• 3,060 points
31 views
0 votes
1 answer

Python pygame error : Failed loading libpng.dylib: dlopen(libpng.dylib, 2): image not found

Try installing libpng You can do it with ...READ MORE

answered May 31 in Python by SDeb
• 13,160 points
52 views