Skip to content

Commit

Permalink
Log score and time in 'cross_val_score'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderFabisch committed Jan 11, 2014
1 parent 30c86ea commit 389ed8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sklearn/cross_validation.py
Expand Up @@ -1119,6 +1119,9 @@ def _cross_val_score(estimator, X, y, scorer, train, test,

scoring_time = time.time() - start_time

if verbose > 1:
print("score %f in %f s" % (score, scoring_time))

return score, _num_samples(X_test), scoring_time


Expand Down
3 changes: 2 additions & 1 deletion sklearn/grid_search.py
Expand Up @@ -236,7 +236,8 @@ def fit_grid_point(X, y, estimator, parameters, train, test, scorer,

estimator.set_params(**parameters)
score, n_samples_test, scoring_time = _cross_val_score(
estimator, X, y, scorer, train, test, verbose, fit_params)
estimator, X, y, scorer, train, test, verbose=0,
fit_params=fit_params)

if verbose > 2:
msg += ", score=%f" % score
Expand Down

0 comments on commit 389ed8d

Please sign in to comment.