ray.train.Result#
- class ray.train.Result(metrics: Dict[str, Any] | None, checkpoint: Checkpoint | None, error: TrainingFailedError | None, path: str, metrics_dataframe: pandas.DataFrame | None = None, best_checkpoints: List[Tuple[Checkpoint, Dict[str, Any]]] | None = None, _storage_filesystem: pyarrow.fs.FileSystem | None = None, return_value: Any | None = None)#
Bases:
ResultThe output of
trainer.fit().- metrics#
The latest set of metrics reported by the training function via
ray.train.report().
- checkpoint#
The latest checkpoint saved by the training function via
ray.train.report().- Type:
ray.train.Checkpoint | None
- return_value#
The value returned by the user-defined training function on the rank 0 worker, or
Noneif no value was returned or if training did not complete successfully. The return value must be serializable.- Type:
Any | None
- metrics_dataframe#
A DataFrame of metrics from all checkpoints saved during the run. Each row corresponds to a checkpoint.
- best_checkpoints#
A list of
(checkpoint, metrics)tuples for the best checkpoints saved during the run. The checkpoints retained are determined byCheckpointConfig(by default, all checkpoints are kept).- Type:
List[Tuple[ray.train.Checkpoint, Dict[str, Any]]] | None
- path#
Path pointing to the run output directory on persistent storage. This can point to a remote storage location (e.g. S3) or to a local location on the head node.
- error#
The execution error of the training run, if the run finished in error. This is a
TrainingFailedErrorwrapping the original exception.- Type:
- property config: Dict[str, Any] | None#
Warning
DEPRECATED: This API is deprecated and may be removed in future Ray releases.
- classmethod from_path(path: str | PathLike, storage_filesystem: pyarrow.fs.FileSystem | None = None) Result[source]#
Restore a training result from a previously saved training run path.
- Parameters:
path – Path to the run output directory
storage_filesystem – Optional filesystem to use for accessing the path
- Returns:
Result object with restored checkpoints and metrics