Skip to content

Commit 6d7f1f1

Browse files
mathazizAbdellaziz
andauthored
Add shape of stratify in train_test_split documentation (scikit-learn#34510)
Co-authored-by: Abdellaziz <abdellazizmaths@gmail.com>
1 parent 300da53 commit 6d7f1f1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

sklearn/model_selection/_split.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,9 +2813,10 @@ def train_test_split(
28132813
28142814
Parameters
28152815
----------
2816-
*arrays : sequence of indexables with same length / shape[0]
2817-
Allowed inputs are lists, numpy arrays, scipy-sparse
2818-
matrices or pandas dataframes.
2816+
*arrays : sequence of array-like of shape (n_samples,) or \
2817+
(n_samples, n_outputs)
2818+
Indexable data-structures can be arrays, lists, dataframes, scipy
2819+
sparse matrices or pandas dataframes with consistent first dimension.
28192820
28202821
test_size : float or int, default=None
28212822
If float, should be between 0.0 and 1.0 and represent the proportion
@@ -2839,7 +2840,7 @@ def train_test_split(
28392840
Whether or not to shuffle the data before splitting. If shuffle=False
28402841
then stratify must be None.
28412842
2842-
stratify : array-like, default=None
2843+
stratify : array-like of shape (n_samples,), default=None
28432844
If not None, data is split in a stratified fashion, using this as
28442845
the class labels.
28452846
Read more in the :ref:`User Guide <stratification>`.

0 commit comments

Comments
 (0)