PythonForDataScience icon indicating copy to clipboard operation
PythonForDataScience copied to clipboard

sklearn.cross_validation.KFold updates

Open aedunn6 opened this issue 9 years ago • 2 comments

Running crossValidate.py with the latest version of sklearn gave this error:

Traceback (most recent call last): File "crossValidate.py", line 29, in main() File "crossValidate.py", line 16, in main cv = cross_validation.KFold(len(train), k=5, indices=False) TypeError: init() got an unexpected keyword argument 'k'

Changing "k=5" to "n_folds=5", per the documentation fixed the error.

However, I then got this warning:

DeprecationWarning: The indices parameter is deprecated and will be removed (assumed True) in 0.17 stacklevel=1)

aedunn6 avatar Mar 11 '15 16:03 aedunn6

This means that the indices argument will no longer be supported and a warning to alter your code before the next release. Its to make sure your code doesn't break all of a sudden.

PNR-1 avatar Oct 06 '16 13:10 PNR-1

means that the indices argument will no longer be supported and a warning to alter your code before the next release. Its to make sure your code doesn't break all of a sudden.

kareemkhater avatar Dec 28 '23 20:12 kareemkhater