Skip to content

Commit 716819b

Browse files
committed
explain learning_curve(shuffle=True) test.
1 parent 707b6f9 commit 716819b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sklearn/model_selection/tests/test_validation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,15 @@ def test_learning_curve_with_boolean_indices():
717717

718718

719719
def test_learning_curve_with_shuffle():
720-
"""Following test case was designed this way to verify the code
721-
changes made in pull request: #7506."""
720+
# Following test case was designed this way to verify the code
721+
# changes made in pull request: #7506.
722722
X = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [11, 12], [13, 14], [15, 16],
723723
[17, 18], [19, 20], [7, 8], [9, 10], [11, 12], [13, 14],
724724
[15, 16], [17, 18]])
725725
y = np.array([1, 1, 1, 2, 3, 4, 1, 1, 2, 3, 4, 1, 2, 3, 4])
726726
groups = np.array([1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 4, 4, 4, 4])
727+
# Splits on these groups fail without shuffle as the first iteration
728+
# of the learning curve doesn't contain label 4 in the training set.
727729
estimator = PassiveAggressiveClassifier(shuffle=False)
728730

729731
cv = GroupKFold(n_splits=2)

0 commit comments

Comments
 (0)