-
- Downloads
[MRG+2] Timing and training score in GridSearchCV (#7325)
* Resolved issue #6894 and #6895: Now *SearchCV.results_ includes both timing and training scores. wrote new test (sklearn/model_selection/test_search.py) and new doctest (sklearn/model_selection/_search.py) added a few more lines in the docstring of GridSearchCV and RandomizedSearchCV. Revised code according to suggestions. Add a few more lines to test_grid_search_results(): 1. check test_rank_score always >= 1 2. check all regular scores (test/train_mean/std_score) and timing >= 0 3. check all regular scores <= 1 Note that timing can be greater than 1 in general, and std of regular scores always <= 1 because the scores are bounded between 0 and 1. * ENH/FIX timing and training score. * ENH separate fit / score times * Make score_time=0 if errored; Ignore warnings in test * Cleanup docstrings * ENH Use helper to store the results * Move fit time computation to else of try...except...else * DOC readable sample scores * COSMIT Add a commnent on why time test is >= 0 instead of > 0 (Windows time.time precision is not accurate enought to be non-zero for trivial fits) * Convey that times are in seconds
Showing
- doc/whats_new.rst 22 additions, 0 deletionsdoc/whats_new.rst
- sklearn/model_selection/_search.py 106 additions, 48 deletionssklearn/model_selection/_search.py
- sklearn/model_selection/_validation.py 22 additions, 10 deletionssklearn/model_selection/_validation.py
- sklearn/model_selection/tests/test_search.py 149 additions, 70 deletionssklearn/model_selection/tests/test_search.py
Loading
Please register or sign in to comment