Skip to content

Commit

Permalink
explain learning_curve(shuffle=True) test.
Browse files Browse the repository at this point in the history
  • Loading branch information
amueller committed Oct 20, 2016
1 parent 707b6f9 commit 716819b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sklearn/model_selection/tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 716819b

Please sign in to comment.