Skip to content

Commit

Permalink
DOC add link to stratification UG for train_test_split (#18735)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirisakow committed Nov 10, 2020
1 parent 020479a commit 35b3195
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/modules/cross_validation.rst
Expand Up @@ -518,6 +518,8 @@ Here is a visualization of the cross-validation behavior. Note that
validation that allows a finer control on the number of iterations and
the proportion of samples on each side of the train / test split.

.. _stratification:

Cross-validation iterators with stratification based on class labels.
---------------------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions sklearn/model_selection/_split.py
Expand Up @@ -2120,6 +2120,7 @@ def train_test_split(*arrays,
stratify : array-like, default=None
If not None, data is split in a stratified fashion, using this as
the class labels.
Read more in the :ref:`User Guide <stratification>`.
Returns
-------
Expand Down

0 comments on commit 35b3195

Please sign in to comment.