ray.tune.ResultGrid.get_best_result#
- ResultGrid.get_best_result(metric: str | None = None, mode: str | None = None, scope: str = 'last', filter_nan_and_inf: bool = True) Result [source]#
Get the best result from all the trials run.
- Parameters:
metric – Key for trial info to order on. Defaults to the metric specified in your Tuner’s
TuneConfig
.mode – One of [min, max]. Defaults to the mode specified in your Tuner’s
TuneConfig
.scope – One of [all, last, avg, last-5-avg, last-10-avg]. If
scope=last
, only look at each trial’s final step formetric
, and compare across trials based onmode=[min,max]
. Ifscope=avg
, consider the simple average over all steps formetric
and compare across trials based onmode=[min,max]
. Ifscope=last-5-avg
orscope=last-10-avg
, consider the simple average over the last 5 or 10 steps formetric
and compare across trials based onmode=[min,max]
. Ifscope=all
, find each trial’s min/max score formetric
based onmode
, and compare trials based onmode=[min,max]
.filter_nan_and_inf – If True (default), NaN or infinite values are disregarded and these trials are never selected as the best trial.