DOC Clarify documentation for GridSearchCV.refit
@@ -919,7 +919,10 @@ class GridSearchCV(BaseSearchCV):
Where there are considerations other than maximum score in
choosing a best estimator, ``refit`` can be set to a function which
- returns the selected ``best_index_`` given ``cv_results_``.
+ returns the selected ``best_index_`` given ``cv_results_``. In that
+ case, the ``best_estimator_`` and ``best_parameters_`` will be set
+ according to the returned ``best_index_`` while the ``best_score_``
+ attribute will not be availble.
The refitted estimator is made available at the ``best_estimator_``
attribute and permits using ``predict`` directly on this
@@ -928,7 +931,7 @@ class GridSearchCV(BaseSearchCV):
Also for multiple metric evaluation, the attributes ``best_index_``,
``best_score_`` and ``best_params_`` will only be available if
``refit`` is set and all of them will be determined w.r.t this specific
- scorer. ``best_score_`` is not returned if refit is callable.
+ scorer.
See ``scoring`` parameter to know more about multiple metric
evaluation.
@@ -1044,6 +1047,8 @@ class GridSearchCV(BaseSearchCV):
For multi-metric evaluation, this is present only if ``refit`` is
specified.
+ This attribute is not available if ``refit`` is a function.
+
best_params_ : dict
Parameter setting that gave the best results on the hold out data.
@@ -1246,7 +1251,10 @@ class RandomizedSearchCV(BaseSearchCV):
Where there are considerations other than maximum score in
choosing a best estimator, ``refit`` can be set to a function which
- returns the selected ``best_index_`` given the ``cv_results``.
+ returns the selected ``best_index_`` given the ``cv_results``. In that
+ case, the ``best_estimator_`` and ``best_parameters_`` will be set
+ according to the returned ``best_index_`` while the ``best_score_``
+ attribute will not be availble.
The refitted estimator is made available at the ``best_estimator_``
attribute and permits using ``predict`` directly on this
@@ -1255,7 +1263,7 @@ class RandomizedSearchCV(BaseSearchCV):
Also for multiple metric evaluation, the attributes ``best_index_``,
``best_score_`` and ``best_params_`` will only be available if
``refit`` is set and all of them will be determined w.r.t this specific
- scorer. When refit is callable, ``best_score_`` is disabled.
+ scorer.
See ``scoring`` parameter to know more about multiple metric
evaluation.
@@ -1358,6 +1366,8 @@ class RandomizedSearchCV(BaseSearchCV):
For multi-metric evaluation, this is not available if ``refit`` is
``False``. See ``refit`` parameter for more information.
+ This attribute is not available if ``refit`` is a function.
+
best_params_ : dict
Parameter setting that gave the best results on the hold out data.
