小编dr2*_*509的帖子

声称'Shuffle'是model_selection.train_test_split的无效参数

因此,当我尝试运行以下行代码时:

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)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

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).
Run Code Online (Sandbox Code Playgroud)

我尝试了不同的参数顺序,分别拆分X和Y,但没有产生任何结果.有没有其他方法可以阻止train_test_split随机化数据?

machine-learning python-3.x scikit-learn

5
推荐指数
1
解决办法
3907
查看次数