|
1 | | - |
2 | 1 | """ |
3 | 2 | The :mod:`sklearn.cross_validation` module includes utilities for cross- |
4 | 3 | validation and performance evaluation. |
@@ -297,9 +296,11 @@ class KFold(_BaseKFold): |
297 | 296 | shuffle : boolean, optional |
298 | 297 | Whether to shuffle the data before splitting into batches. |
299 | 298 |
|
300 | | - random_state : None, int or RandomState |
301 | | - When shuffle=True, pseudo-random number generator state used for |
302 | | - shuffling. If None, use default numpy RNG for shuffling. |
| 299 | + random_state : int, RandomState instance or None, optional, default=None |
| 300 | + If int, random_state is the seed used by the random number |
| 301 | + generator; If RandomState instance, random_state is the random number |
| 302 | + generator; If None, the random number generator is the RandomState |
| 303 | + instance used by `np.random`. Used when ``shuffle`` == True. |
303 | 304 |
|
304 | 305 | Examples |
305 | 306 | -------- |
@@ -499,9 +500,11 @@ class StratifiedKFold(_BaseKFold): |
499 | 500 | Whether to shuffle each stratification of the data before splitting |
500 | 501 | into batches. |
501 | 502 |
|
502 | | - random_state : None, int or RandomState |
503 | | - When shuffle=True, pseudo-random number generator state used for |
504 | | - shuffling. If None, use default numpy RNG for shuffling. |
| 503 | + random_state : int, RandomState instance or None, optional, default=None |
| 504 | + If int, random_state is the seed used by the random number |
| 505 | + generator; If RandomState instance, random_state is the random number |
| 506 | + generator; If None, the random number generator is the RandomState |
| 507 | + instance used by `np.random`. Used when ``shuffle`` == True. |
505 | 508 |
|
506 | 509 | Examples |
507 | 510 | -------- |
@@ -822,8 +825,11 @@ class ShuffleSplit(BaseShuffleSplit): |
822 | 825 | int, represents the absolute number of train samples. If None, |
823 | 826 | the value is automatically set to the complement of the test size. |
824 | 827 |
|
825 | | - random_state : int or RandomState |
826 | | - Pseudo-random number generator state used for random sampling. |
| 828 | + random_state : int, RandomState instance or None, optional (default None) |
| 829 | + If int, random_state is the seed used by the random number generator; |
| 830 | + If RandomState instance, random_state is the random number generator; |
| 831 | + If None, the random number generator is the RandomState instance used |
| 832 | + by `np.random`. |
827 | 833 |
|
828 | 834 | Examples |
829 | 835 | -------- |
@@ -1031,8 +1037,11 @@ class StratifiedShuffleSplit(BaseShuffleSplit): |
1031 | 1037 | int, represents the absolute number of train samples. If None, |
1032 | 1038 | the value is automatically set to the complement of the test size. |
1033 | 1039 |
|
1034 | | - random_state : int or RandomState |
1035 | | - Pseudo-random number generator state used for random sampling. |
| 1040 | + random_state : int, RandomState instance or None, optional (default None) |
| 1041 | + If int, random_state is the seed used by the random number generator; |
| 1042 | + If RandomState instance, random_state is the random number generator; |
| 1043 | + If None, the random number generator is the RandomState instance used |
| 1044 | + by `np.random`. |
1036 | 1045 |
|
1037 | 1046 | Examples |
1038 | 1047 | -------- |
@@ -1225,8 +1234,11 @@ class LabelShuffleSplit(ShuffleSplit): |
1225 | 1234 | int, represents the absolute number of train labels. If None, |
1226 | 1235 | the value is automatically set to the complement of the test size. |
1227 | 1236 |
|
1228 | | - random_state : int or RandomState |
1229 | | - Pseudo-random number generator state used for random sampling. |
| 1237 | + random_state : int, RandomState instance or None, optional (default None) |
| 1238 | + If int, random_state is the seed used by the random number generator; |
| 1239 | + If RandomState instance, random_state is the random number generator; |
| 1240 | + If None, the random number generator is the RandomState instance used |
| 1241 | + by `np.random`. |
1230 | 1242 |
|
1231 | 1243 | """ |
1232 | 1244 | def __init__(self, labels, n_iter=5, test_size=0.2, train_size=None, |
@@ -1889,9 +1901,11 @@ def permutation_test_score(estimator, X, y, cv=None, |
1889 | 1901 | Labels constrain the permutation among groups of samples with |
1890 | 1902 | a same label. |
1891 | 1903 |
|
1892 | | - random_state : RandomState or an int seed (0 by default) |
1893 | | - A random number generator instance to define the state of the |
1894 | | - random permutations generator. |
| 1904 | + random_state : int, RandomState instance or None, optional (default=0) |
| 1905 | + If int, random_state is the seed used by the random number generator; |
| 1906 | + If RandomState instance, random_state is the random number generator; |
| 1907 | + If None, the random number generator is the RandomState instance used |
| 1908 | + by `np.random`. |
1895 | 1909 |
|
1896 | 1910 | verbose : integer, optional |
1897 | 1911 | The verbosity level. |
@@ -1977,8 +1991,11 @@ def train_test_split(*arrays, **options): |
1977 | 1991 | int, represents the absolute number of train samples. If None, |
1978 | 1992 | the value is automatically set to the complement of the test size. |
1979 | 1993 |
|
1980 | | - random_state : int or RandomState |
1981 | | - Pseudo-random number generator state used for random sampling. |
| 1994 | + random_state : int, RandomState instance or None, optional (default=None) |
| 1995 | + If int, random_state is the seed used by the random number generator; |
| 1996 | + If RandomState instance, random_state is the random number generator; |
| 1997 | + If None, the random number generator is the RandomState instance used |
| 1998 | + by `np.random`. |
1982 | 1999 |
|
1983 | 2000 | stratify : array-like or None (default is None) |
1984 | 2001 | If not None, data is split in a stratified fashion, using this as |
|
0 commit comments