Skip to content
Snippets Groups Projects
Select Git revision
0 results

test_search.py

  • Raghav RV's avatar
    b444cc9c
    [MRG+2] Timing and training score in GridSearchCV (#7325) · b444cc9c
    Raghav RV authored
    * 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
    b444cc9c
    History
    [MRG+2] Timing and training score in GridSearchCV (#7325)
    Raghav RV authored
    * 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