PythonForDataScience
PythonForDataScience copied to clipboard
sklearn.cross_validation.KFold updates
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)
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.
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.