Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Shuffle' is claimed to be an invalid parameter for model_selection.train_test_split

So when I try to run some code featuring the line below:

X_train, X_test, Y_train, Y_test=train_test_split(X_features, Y_feature, test_size=0.2, random_state=42, stratify=None, shuffle=False)

I get the following error:

TypeError: Invalid parameters passed: {'shuffle': False}
Yet, the 'shuffle' parameter is listed on scikitlearn website (http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html).

I tried different order for parameters, splitting X and Y separately, but that yielded no result. Is there any other way I could prevent train_test_split from randomizing the data?

like image 226
dr2509 Avatar asked Aug 28 '17 01:08

dr2509


1 Answers

Shuffle has been introduced in 0.19, you are probably using 0.18 or older which was following different API.

like image 84
lejlot Avatar answered Oct 03 '22 04:10

lejlot