Reputation: 741
import numpy as np
from sklearn.cross_validation import train_test_split as tts
a = np.array([[1,2,3,4,5]]).T
b = np.array([[100,200,50,60,3000]]).T
x1,x2,y1,y2 = tts(a,b, test_size=0.2, shuffle=False)
print(x1)
print(x2)
print(y1)
print(y2)
I always receive following error:
builtins.TypeError: Invalid parameters passed: {'shuffle': False}
I have checked documentation:
shuffle : boolean, optional (default=True) Whether or not to shuffle the data before splitting. If shuffle=False then stratify must be None.
added stratify=None
, but I get still the same error. Any idea how to solve this?
Upvotes: 2
Views: 2925
Reputation: 1194
This is caused by outdated version of sklearn
. The documentation refers to version 0.19.0. The version of sklearn
that is currently installed can be checked by typing
>>> print(sklearn.__version__)
Upvotes: 2