Skip to content

Commit

Permalink
[MRG + 1] Printing the total time in cross_validation (scikit-learn#7640
Browse files Browse the repository at this point in the history
)

* print score+fit time instead of just score time when doing cross_validation

* reducing line size

* More clearer log message
  • Loading branch information
srivatsan-ramesh authored and TomDLT committed Oct 24, 2016
1 parent 5c60f1f commit 177ac84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sklearn/model_selection/_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ def _fit_and_score(estimator, X, y, scorer, train, test, verbose,
if verbose > 2:
msg += ", score=%f" % test_score
if verbose > 1:
end_msg = "%s -%s" % (msg, logger.short_format_time(score_time))
total_time = score_time + fit_time
end_msg = "%s, total=%s" % (msg, logger.short_format_time(total_time))
print("[CV] %s %s" % ((64 - len(end_msg)) * '.', end_msg))

ret = [train_score, test_score] if return_train_score else [test_score]
Expand Down

0 comments on commit 177ac84

Please sign in to comment.