Skip to content

Commit

Permalink
Make scoring test about missing validation data more rigorous.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-work authored and ottonemo committed Nov 13, 2017
1 parent 8b303de commit 249c04a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions skorch/tests/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,23 @@ def test_best_score_when_lower_is_better(
net.history[:, 'score_best']

def test_no_error_when_no_valid_data(
self, net_cls, module_cls, mse_scoring, data,
self, net_cls, module_cls, mse_scoring, train_split, data,
):
net = net_cls(
module_cls,
callbacks=[mse_scoring],
max_epochs=1,
train_split=None,
max_epochs=3,
train_split=train_split,
)
# does not raise
net.fit(*data)

net.train_split = None
# does not raise
net.partial_fit(*data)

# only the first 3 epochs wrote scores
assert len(net.history[:, 'nmse']) == 3

def test_with_accuracy_score(
self, net_cls, module_cls, scoring_cls, train_split, data,
):
Expand Down

0 comments on commit 249c04a

Please sign in to comment.