sklearn cross validation import train test split not working

+1 vote

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
18,603 views
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
+1 vote
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
3,360 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,260 points
2,555 views
+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
12,008 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, 2019 in Python by anonymous
1,195 views
0 votes
1 answer

Python string replace not working

The replace method doesn’t store the altered ...READ MORE

answered Apr 4, 2019 in Python by Tina

edited Oct 7, 2021 by Sarfaraz 16,968 views
0 votes
1 answer

Python - Ubuntu install for SQLAlchemy not working

You can try using the version directly ...READ MORE

answered May 14, 2019 in Python by SDeb
• 13,300 points
2,251 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,434 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
4,070 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