ray.tune.ExperimentAnalysis.get_best_config#
- ExperimentAnalysis.get_best_config(metric: str | None = None, mode: str | None = None, scope: str = 'last') Dict | None [source]#
Retrieve the best config corresponding to the trial.
Compares all trials’ scores on
metric
. Ifmetric
is not specified,self.default_metric
will be used. Ifmode
is not specified,self.default_mode
will be used. These values are usually initialized by passing themetric
andmode
parameters totune.run()
.- Parameters:
metric – Key for trial info to order on. Defaults to
self.default_metric
.mode – One of [min, max]. Defaults to
self.default_mode
.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]
.