From 716819b5a3cff2a13ef6cc8b7c3a901b4c4f1634 Mon Sep 17 00:00:00 2001
From: Andreas Mueller <amueller@nyu.edu>
Date: Wed, 19 Oct 2016 15:46:15 -0400
Subject: [PATCH] explain learning_curve(shuffle=True) test.

---
 sklearn/model_selection/tests/test_validation.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sklearn/model_selection/tests/test_validation.py b/sklearn/model_selection/tests/test_validation.py
index eb29be1a2a..26af0f76e6 100644
--- a/sklearn/model_selection/tests/test_validation.py
+++ b/sklearn/model_selection/tests/test_validation.py
@@ -717,13 +717,15 @@ def test_learning_curve_with_boolean_indices():
 
 
 def test_learning_curve_with_shuffle():
-    """Following test case was designed this way to verify the code
-    changes made in pull request: #7506."""
+    # Following test case was designed this way to verify the code
+    # changes made in pull request: #7506.
     X = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [11, 12], [13, 14], [15, 16],
                  [17, 18], [19, 20], [7, 8], [9, 10], [11, 12], [13, 14],
                  [15, 16], [17, 18]])
     y = np.array([1, 1, 1, 2, 3, 4, 1, 1, 2, 3, 4, 1, 2, 3, 4])
     groups = np.array([1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 4, 4, 4, 4])
+    # Splits on these groups fail without shuffle as the first iteration
+    # of the learning curve doesn't contain label 4 in the training set.
     estimator = PassiveAggressiveClassifier(shuffle=False)
 
     cv = GroupKFold(n_splits=2)
-- 
GitLab