Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sklearn.cross_validation LabelKFold gives warnings and erros #6964

Closed
StevenLOL opened this issue Jul 7, 2016 · 3 comments
Closed

sklearn.cross_validation LabelKFold gives warnings and erros #6964

StevenLOL opened this issue Jul 7, 2016 · 3 comments

Comments

@StevenLOL
Copy link

Cloned sklearn today 7-7-2016

sklearn.version
'0.18.dev0'

from sklearn.cross_validation import train_test_split, LabelKFold
'''.......DeprecationWarning'''
a=LabelKFold(4)
TypeError: object of type 'int' has no len()
a=LabelKFold(n_folds=4)
TypeError: __init__() takes at least 2 arguments (2 given)

There will be no problem if :

from sklearn.model_selection import LabelKFold
@jnothman
Copy link
Member

jnothman commented Jul 7, 2016

What code includes from sklearn.cross_validation import train_test_split, LabelKFold?

@StevenLOL
Copy link
Author

OK, I think this is not a problem as the warning message already indicate the differences of two LabelKFold method.

from sklearn.cross_validation import train_test_split, LabelKFold
/usr/local/lib/python2.7/dist-packages/sklearn/cross_validation.py:43: DeprecationWarning: This module has been deprecated in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)

@Masoompirzada
Copy link

Just replace 'from sklearn.cross_validation import train_test_split, LabelKFold' with 'from sklearn.from sklearn.model_selection import train_test_split, LabelKFold'

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

No branches or pull requests

3 participants