From dcd8267be381221253c42aa1494b9d036db85eb8 Mon Sep 17 00:00:00 2001 From: taylorkm Date: Wed, 13 Sep 2017 18:22:40 -0400 Subject: [PATCH 1/4] Adding parameter information to docstring. --- sklearn/model_selection/_split.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index fbc00f3069e51..929c91a045c5a 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -1706,9 +1706,12 @@ def _validate_shuffle_split(n_samples, test_size, train_size): class PredefinedSplit(BaseCrossValidator): """Predefined split cross-validator - Splits the data into training/test set folds according to a predefined - scheme. Each sample can be assigned to at most one test set fold, as - specified by the user through the ``test_fold`` parameter. + Provides train/test indices to split data into train/test sets using a + predefined scheme specified by the user with the ``test_fold`` parameter. + The entry ``test_fold[i]`` represents the index of the test set that + sample ``i`` belongs to. It is possible to exclude sample ``i`` from any + test set (i.e. include sample ``i`` in every training set) by setting + ``test_fold[i]`` equal to -1. Read more in the :ref:`User Guide `. From 86fea3eb698a1f1dda710815eb51a4c15f14eb7b Mon Sep 17 00:00:00 2001 From: taylorkm Date: Wed, 13 Sep 2017 19:13:26 -0400 Subject: [PATCH 2/4] Removing trailing whitespace from lines. --- sklearn/model_selection/_split.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index 929c91a045c5a..61305646e4b09 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -1708,9 +1708,9 @@ class PredefinedSplit(BaseCrossValidator): Provides train/test indices to split data into train/test sets using a predefined scheme specified by the user with the ``test_fold`` parameter. - The entry ``test_fold[i]`` represents the index of the test set that + The entry ``test_fold[i]`` represents the index of the test set that sample ``i`` belongs to. It is possible to exclude sample ``i`` from any - test set (i.e. include sample ``i`` in every training set) by setting + test set (i.e. include sample ``i`` in every training set) by setting ``test_fold[i]`` equal to -1. Read more in the :ref:`User Guide `. From df6ccf1be6b12e51a61180dac55348694970f69a Mon Sep 17 00:00:00 2001 From: taylorkm Date: Wed, 13 Sep 2017 19:49:40 -0400 Subject: [PATCH 3/4] Adding details of parameter to formal Parameters section. --- sklearn/model_selection/_split.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index 61305646e4b09..05044083abca6 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -1708,13 +1708,17 @@ class PredefinedSplit(BaseCrossValidator): Provides train/test indices to split data into train/test sets using a predefined scheme specified by the user with the ``test_fold`` parameter. - The entry ``test_fold[i]`` represents the index of the test set that - sample ``i`` belongs to. It is possible to exclude sample ``i`` from any - test set (i.e. include sample ``i`` in every training set) by setting - ``test_fold[i]`` equal to -1. Read more in the :ref:`User Guide `. + Parameters + ---------- + test_fold : array-like, shape (n_samples,) + The entry ``test_fold[i]`` represents the index of the test set that + sample ``i`` belongs to. It is possible to exclude sample ``i`` from any + test set (i.e. include sample ``i`` in every training set) by setting + ``test_fold[i]`` equal to -1. + Examples -------- >>> from sklearn.model_selection import PredefinedSplit From 840738271d5b481270f3d40b80d4f7c408a67d1f Mon Sep 17 00:00:00 2001 From: taylorkm Date: Wed, 13 Sep 2017 20:38:17 -0400 Subject: [PATCH 4/4] Shortened lines to meet requirements. --- sklearn/model_selection/_split.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index 05044083abca6..113a015c2bbca 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -1713,11 +1713,11 @@ class PredefinedSplit(BaseCrossValidator): Parameters ---------- - test_fold : array-like, shape (n_samples,) + test_fold : array-like, shape (n_samples,) The entry ``test_fold[i]`` represents the index of the test set that - sample ``i`` belongs to. It is possible to exclude sample ``i`` from any - test set (i.e. include sample ``i`` in every training set) by setting - ``test_fold[i]`` equal to -1. + sample ``i`` belongs to. It is possible to exclude sample ``i`` from + any test set (i.e. include sample ``i`` in every training set) by + setting ``test_fold[i]`` equal to -1. Examples --------