7

After I have built a model with GridSearchCV, I get the cross validation results with model.cv_results_. But among the results one parameter is confusing to me. What does rank_test_score stand for in this?

mean_fit_time                                        0.00265972
std_fit_time                                        0.000466648
mean_score_time                                      0.00133236
std_score_time                                      0.000470977
param_n_neighbors                                             1
param_weights                                          distance
params                {'n_neighbors': 1, 'weights': 'distance'}
split0_test_score                                       0.70405
split1_test_score                                       0.73125
split2_test_score                                       0.69906
mean_test_score                                        0.711458
std_test_score                                        0.0141423
rank_test_score                                               1
split0_train_score                                            1
split1_train_score                                            1
split2_train_score                                            1
mean_train_score                                              1
std_train_score                                               0
Name: 1, dtype: object
JimminyCricket
  • 371
  • 3
  • 14

1 Answers1

7

rank_test_score indicates the rank of a grid search parameter combination based on the mean_test_score.

If you try N parameter combinations in your grid search, rank_test_score reaches from 1 to N.

The parameter combination that results in the lowest mean_test_score will have a rank_test_score of N and the parameter combination with the highest mean_test_score will have a rank_test_score of 1.

If you use multiple metrics for evaluation (say, 'neg_mean_squared_error' and 'neg_mean_absolute_error') you will have more columns (here rank_test_neg_mean_squared_error and rank_test_neg_mean_absolute_error), each indicating the rank of the estimator based on the respective metric.

simweb
  • 211
  • 2
  • 9