- class ray.train.Result(metrics: Optional[Dict[str, Any]], checkpoint: Optional[Checkpoint], error: Optional[Exception], metrics_dataframe: Optional[pd.DataFrame] = None, best_checkpoints: Optional[List[Tuple[Checkpoint, Dict[str, Any]]]] = None, _local_path: Optional[str] = None, _remote_path: Optional[str] = None, _storage_filesystem: Optional[pyarrow.fs.FileSystem] = None)#
The final result of a ML training run or a Tune trial.
This is the class produced by Trainer.fit(). It contains a checkpoint, which can be used for resuming training and for creating a Predictor object. It also contains a metrics object describing training metrics.
erroris included so that unsuccessful runs and trials can be represented as well.
The constructor is a private API.
The execution error of the Trainable run, if the trial finishes in error.
The full result dataframe of the Trainable. The dataframe is indexed by iterations and contains reported metrics.
A list of tuples of the best checkpoints saved by the Trainable and their associated metrics. The number of saved checkpoints is determined by the
run_config(by default, all checkpoints will be saved).
- property filesystem: pyarrow.fs.FileSystem#
Return the filesystem that can be used to access the result path.
- classmethod from_path(path: Union[str, os.PathLike]) ray.train.Result #
Restore a Result object from local trial directory.
path – the path to a local trial directory.
Resultobject of that trial.
- get_best_checkpoint(metric: str, mode: str) Optional[Checkpoint] #
Get the best checkpoint from this trial based on a specific metric.
Any checkpoints without an associated metric value will be filtered out.
metric – The key for checkpoints to order on.
mode – One of [“min”, “max”].
Checkpointobject, or None if there is no valid checkpoint associated with the metric.
PublicAPI (alpha): This API is in alpha and may change before becoming stable.
- property path: str#
Path pointing to the result directory on persistent storage.
This can point to a remote storage location (e.g. S3) or to a local location (path on the head node). The path is accessible via the result’s associated
For instance, for a result stored in S3 at
pathwill have the value