Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

ShuffleSplit #347

Closed
arembridge opened this issue Sep 2, 2018 · 5 comments
Closed

ShuffleSplit #347

arembridge opened this issue Sep 2, 2018 · 5 comments

Comments

@arembridge
Copy link

arembridge commented Sep 2, 2018

https://github.com/udacity/machine-learning/blob/master/projects/boston_housing/boston_housing.ipynb

The below line of code in udacity/machine-learning/boston_housing.ipynb failed for me:

  • from sklearn.cross_validation import ShuffleSplit

I believe it should be:

  • from sklearn.model_selection import ShuffleSplit

This is also the case in https://github.com/udacity/machine-learning/blob/master/projects/visuals.py. I believe the following line:

  • from sklearn.cross_validation import ShuffleSplit, train_test_split

should be

  • from sklearn.model_selection import ShuffleSplit, train_test_split
@singhjagmohan1000
Copy link
Contributor

@arembridge Is code failed or it gave Deprecation warning? sklearn.cross_validation was deprecated in version 0.18 and as you said new version has sklearn.model_selection.

@arembridge
Copy link
Author

It is deprecated. I have changed the code and got it to work here:

https://github.com/arembridge/machine-learning/blob/master/projects/boston_housing/visuals.py

@tanujdhiman
Copy link

Exactly sklearn.cross_validation was deprecated. Work with sklearn.model_selection.

@Ashishkumarpanda
Copy link

Sklearn.cross_validation was depricated
Try using sklearn.model_selection

@ronny-udacity
Copy link
Contributor

Starting from sklearn v0.20, the package sklearn.cross_validation is now deprecated. If you're using sklearn's newer version, please change this line of code:

  • from: from sklearn.cross_validation import ShuffleSplit
  • to: from sklearn.model_selection import ShuffleSplit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants