scikit-learn random state in splitting dataset

后端 未结 9 1937
无人共我
无人共我 2020-12-05 09:12

Can anyone tell me why we set random state to zero in splitting train and test set.

X_train, X_test, y_train, y_test = \\
    train_test_split(X, y, test_size         


        
9条回答
  •  一生所求
    2020-12-05 10:05

    For multiple times of execution of our model, random state make sure that data values will be same for training and testing data sets. It fixes the order of data for train_test_split

提交回复
热议问题