Skip to content

Commit 177ac84

Browse files
srivatsan-rameshTomDLT
authored andcommitted
[MRG + 1] Printing the total time in cross_validation (scikit-learn#7640)
* print score+fit time instead of just score time when doing cross_validation * reducing line size * More clearer log message
1 parent 5c60f1f commit 177ac84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sklearn/model_selection/_validation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ def _fit_and_score(estimator, X, y, scorer, train, test, verbose,
265265
if verbose > 2:
266266
msg += ", score=%f" % test_score
267267
if verbose > 1:
268-
end_msg = "%s -%s" % (msg, logger.short_format_time(score_time))
268+
total_time = score_time + fit_time
269+
end_msg = "%s, total=%s" % (msg, logger.short_format_time(total_time))
269270
print("[CV] %s %s" % ((64 - len(end_msg)) * '.', end_msg))
270271

271272
ret = [train_score, test_score] if return_train_score else [test_score]

0 commit comments

Comments
 (0)