Skip to content

Commit

Permalink
Merge pull request #615 from skorch-dev/bugfix/test-split-size-flaky-…
Browse files Browse the repository at this point in the history
…with-certain-sklearn-versions

Fix a failing test with sklearn 0.21.2
  • Loading branch information
ottonemo committed Apr 11, 2020
2 parents c12f40b + b4c2e8a commit 7a84568
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion skorch/tests/callbacks/test_scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,10 @@ def net(self, classifier_module, train_loss, valid_loss, classifier_data):
n = 75
# n=75 with a 4/5 train/valid split -> 60/15 samples; with a
# batch size of 10, that leads to train batch sizes of
# [10,10,10,10] and valid batich sizes of [10,5]
# [10,10,10,10] and valid batch sizes of [10,5]; all labels
# are set to 0 to ensure that the stratified split is exactly
# equal to the desired split
y = np.zeros_like(y)
return net.fit(X[:n], y[:n])

@pytest.fixture
Expand Down

0 comments on commit 7a84568

Please sign in to comment.