Skip to content

Commit

Permalink
Merge f9a9b83 into f3a4372
Browse files Browse the repository at this point in the history
  • Loading branch information
dnouri committed May 23, 2019
2 parents f3a4372 + f9a9b83 commit 66ffae5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion palladium/fit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Utilities for fitting modles.
"""

import gc
from warnings import warn
import sys

Expand Down Expand Up @@ -74,9 +75,13 @@ def scorer(model, X, y):
annotate(model, {'score_train': score_train})
logger.info("Train score: {}".format(score_train))

X, y = None, None
gc.collect()

score_test = None
if evaluate and dataset_loader_test is not None:
X_test, y_test = dataset_loader_test()
with timer(logger.info, "Loading test data"):
X_test, y_test = dataset_loader_test()
with timer(logger.debug, "Evaluating model on test set"):
score_test = scorer(model, X_test, y_test)
annotate(model, {'score_test': score_test})
Expand Down

0 comments on commit 66ffae5

Please sign in to comment.