1. 描述
Split arrays or matrices into random train and test subsets
2. 语法
train_test_split(*arrays, **options)
3. 参数
1.*arrays:
(sequence of indexables with same length / shape[0])
Allowed inputs are lists
, numpy arrays
, scipy-sparse matrices
or pandas dataframes
.
2.test_size :
(float, int, or None, default None)
If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the train split.
If int, represents the absolute number of train samples.
If None, the value is automatically set to the complement of the test size.
3.random_state :
(int, RandomState instance or None, optional (default=None))
If int, random_state is the seed used by the random number generator;
If None, the random number generator is the RandomSt