From 33fa63d318ed6d353d8c3059fcc9b2b8969a1695 Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Sun, 8 Jun 2025 13:11:18 -0700 Subject: [PATCH 01/11] DOC add link to plot_cv_predict example in cross_val_predict See Also --- sklearn/model_selection/_validation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 8b70bf42603ef..72eac8b458f87 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1143,6 +1143,8 @@ def cross_val_predict( cross_val_score : Calculate score for each CV split. cross_validate : Calculate one or more scores and timings for each CV split. + :ref:`plot_cv_predict.py + ` Notes ----- From 901c76838c3d3a2bc3d91c73fbc69d9130e9471f Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Sun, 8 Jun 2025 13:30:39 -0700 Subject: [PATCH 02/11] DOC wrap plot_cv_predict ref under 88 chars --- sklearn/model_selection/_validation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 72eac8b458f87..262178e937ac6 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1143,8 +1143,11 @@ def cross_val_predict( cross_val_score : Calculate score for each CV split. cross_validate : Calculate one or more scores and timings for each CV split. + + See the example in :ref:`plot_cv_predict.py - ` + `. + Notes ----- From b7557754669f3b4ac956a7e7e190c75de36f5b48 Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Sun, 8 Jun 2025 14:03:53 -0700 Subject: [PATCH 03/11] DOC link plot_cv_predict example in Examples section of cross_val_predict --- sklearn/model_selection/_validation.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 262178e937ac6..e55edc5f1d3b7 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1144,11 +1144,6 @@ def cross_val_predict( cross_validate : Calculate one or more scores and timings for each CV split. - See the example in - :ref:`plot_cv_predict.py - `. - - Notes ----- In the case that one or more classes are absent in a training portion, a @@ -1167,6 +1162,10 @@ def cross_val_predict( >>> y = diabetes.target[:150] >>> lasso = linear_model.Lasso() >>> y_pred = cross_val_predict(lasso, X, y, cv=3) + For a complete walk-through, see the + :ref:`plot_cv_predict.py + ` + example. """ _check_groups_routing_disabled(groups) X, y = indexable(X, y) From cbef4acbcda1d3723032cb9b8b87fa18c443bea9 Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Sun, 8 Jun 2025 16:13:04 -0700 Subject: [PATCH 04/11] DOC comment out plot_cv_predict example link in Examples to satisfy doctest --- sklearn/model_selection/_validation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index e55edc5f1d3b7..24d8b65809c1f 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1162,10 +1162,10 @@ def cross_val_predict( >>> y = diabetes.target[:150] >>> lasso = linear_model.Lasso() >>> y_pred = cross_val_predict(lasso, X, y, cv=3) - For a complete walk-through, see the - :ref:`plot_cv_predict.py - ` - example. + # For a complete walk-through, see the + # :ref:`plot_cv_predict.py + # ` + # example. """ _check_groups_routing_disabled(groups) X, y = indexable(X, y) From 4df31e00a3b47e9dac1f9167d919bf77279b95f9 Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Wed, 11 Jun 2025 09:34:28 -0700 Subject: [PATCH 05/11] DOC add plot_cv_predict example link into Examples section of cross_val_predict --- sklearn/model_selection/_validation.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 24d8b65809c1f..f0cd0d850c8fd 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1161,11 +1161,14 @@ def cross_val_predict( >>> X = diabetes.data[:150] >>> y = diabetes.target[:150] >>> lasso = linear_model.Lasso() + + For a detailed example of using ``cross_val_predict`` to + visualize prediction errors, please see + :ref:`plot_cv_predict.py + ` + example. + >>> y_pred = cross_val_predict(lasso, X, y, cv=3) - # For a complete walk-through, see the - # :ref:`plot_cv_predict.py - # ` - # example. """ _check_groups_routing_disabled(groups) X, y = indexable(X, y) From 5d85c15f656cf6290823c4c25332ba7108fe56ba Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Wed, 11 Jun 2025 10:00:49 -0700 Subject: [PATCH 06/11] DOC add plot_cv_predict example link into Examples section of cross_val_predict --- sklearn/model_selection/_validation.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index f0cd0d850c8fd..ed0c396d12f34 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1162,11 +1162,10 @@ def cross_val_predict( >>> y = diabetes.target[:150] >>> lasso = linear_model.Lasso() - For a detailed example of using ``cross_val_predict`` to - visualize prediction errors, please see - :ref:`plot_cv_predict.py - ` - example. + For a detailed example of using ``cross_val_predict`` to visualize + prediction errors, please see + :ref:`plot_cv_predict example + `. >>> y_pred = cross_val_predict(lasso, X, y, cv=3) """ From e8a4401498092c26bf0f11ea12eaecc4e14b3ac2 Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Wed, 11 Jun 2025 10:24:32 -0700 Subject: [PATCH 07/11] DOC add plot_cv_predict example link into Examples section of cross_val_predict --- sklearn/model_selection/_validation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index ed0c396d12f34..760d864971ad3 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1164,8 +1164,7 @@ def cross_val_predict( For a detailed example of using ``cross_val_predict`` to visualize prediction errors, please see - :ref:`plot_cv_predict example - `. + :ref:`this example `. >>> y_pred = cross_val_predict(lasso, X, y, cv=3) """ From 91ae6c153ad797be89295f046c097f78685a09ee Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Fri, 13 Jun 2025 10:16:36 -0700 Subject: [PATCH 08/11] DOC add plot_cv_predict example link into Examples section of cross_val_predict --- sklearn/model_selection/_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 760d864971ad3..b463b3f620c88 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1161,13 +1161,13 @@ def cross_val_predict( >>> X = diabetes.data[:150] >>> y = diabetes.target[:150] >>> lasso = linear_model.Lasso() + >>> y_pred = cross_val_predict(lasso, X, y, cv=3) For a detailed example of using ``cross_val_predict`` to visualize prediction errors, please see :ref:`this example `. - - >>> y_pred = cross_val_predict(lasso, X, y, cv=3) """ + _check_groups_routing_disabled(groups) X, y = indexable(X, y) params = {} if params is None else params From ce8f34b4b83ede7c0fc49264868c065a8f735ac6 Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Fri, 13 Jun 2025 15:29:00 -0700 Subject: [PATCH 09/11] DOC add plot_cv_predict example link into Examples section of cross_val_predict --- sklearn/model_selection/_validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index b463b3f620c88..0daadce6a6ee6 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1165,7 +1165,7 @@ def cross_val_predict( For a detailed example of using ``cross_val_predict`` to visualize prediction errors, please see - :ref:`this example `. + :ref:``. """ _check_groups_routing_disabled(groups) From 5023eb1d2294577fbe2a28757303441a03902662 Mon Sep 17 00:00:00 2001 From: Sisir Doppalapudi Date: Fri, 13 Jun 2025 15:50:22 -0700 Subject: [PATCH 10/11] DOC add plot_cv_predict example link into Examples section of cross_val_predict --- sklearn/model_selection/_validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 0daadce6a6ee6..b175f26e7ca31 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1165,7 +1165,7 @@ def cross_val_predict( For a detailed example of using ``cross_val_predict`` to visualize prediction errors, please see - :ref:``. + :ref:`sphx_glr_auto_examples_model_selection_plot_cv_predict.py`. """ _check_groups_routing_disabled(groups) From dd06933439393dd836beb036d70a82d8003a2944 Mon Sep 17 00:00:00 2001 From: sisird864 <137139127+sisird864@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:19:41 -0700 Subject: [PATCH 11/11] Update sklearn/model_selection/_validation.py Co-authored-by: Virgil Chan --- sklearn/model_selection/_validation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index b175f26e7ca31..c5a1406e6c2a5 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -1167,7 +1167,6 @@ def cross_val_predict( prediction errors, please see :ref:`sphx_glr_auto_examples_model_selection_plot_cv_predict.py`. """ - _check_groups_routing_disabled(groups) X, y = indexable(X, y) params = {} if params is None else params