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, 2019 in Python by Firoz
its very very very helpful to me. thankyou

2 answers 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, 2019 by Sharan
0 votes
How ever now its in model selection ,

from sklearn.model_selection import train_test_split
answered Jul 17, 2020 by karthikeyan

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 5, 2018 in Python by aayushi
• 750 points
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,260 points
+1 vote
1 answer

Not able to Import scikitplot package in my Jupyter Lab

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

answered Feb 21, 2019 in Python by Yami
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, 2019 in Python by anonymous
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 2,479 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,810 points
0 votes
1 answer

how can i import the tensorflow library in python?

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

answered May 21, 2019 in Python by Mohammad
• 3,230 points
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, 2019 in Python by SDeb
• 13,300 points