2020-04-25 18:25:56 -07:00
|
|
|
.. _tune-analysis-docs:
|
|
|
|
|
|
|
|
Analysis (tune.analysis)
|
|
|
|
========================
|
2020-03-23 12:23:21 -07:00
|
|
|
|
2022-02-27 08:07:34 +01:00
|
|
|
You can use the ``ExperimentAnalysis`` object for analyzing results.
|
|
|
|
It is returned automatically when calling ``tune.run``.
|
2020-04-06 12:16:35 -07:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
analysis = tune.run(
|
|
|
|
trainable,
|
|
|
|
name="example-experiment",
|
|
|
|
num_samples=10,
|
|
|
|
)
|
|
|
|
|
|
|
|
Here are some example operations for obtaining a summary of your experiment:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
# Get a dataframe for the last reported results of all of the trials
|
2020-09-09 05:00:52 +01:00
|
|
|
df = analysis.results_df
|
2020-04-06 12:16:35 -07:00
|
|
|
|
|
|
|
# Get a dataframe for the max accuracy seen for each trial
|
|
|
|
df = analysis.dataframe(metric="mean_accuracy", mode="max")
|
|
|
|
|
|
|
|
# Get a dict mapping {trial logdir -> dataframes} for all trials in the experiment.
|
|
|
|
all_dataframes = analysis.trial_dataframes
|
|
|
|
|
|
|
|
# Get a list of trials
|
|
|
|
trials = analysis.trials
|
|
|
|
|
2022-02-27 08:07:34 +01:00
|
|
|
You may want to get a summary of multiple experiments that point to the same ``local_dir``.
|
|
|
|
This is also supported by the ``ExperimentAnalysis`` class.
|
2020-04-06 12:16:35 -07:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
2021-11-16 17:47:12 +01:00
|
|
|
from ray.tune import ExperimentAnalysis
|
|
|
|
analysis = ExperimentAnalysis("~/ray_results/example-experiment")
|
2020-04-06 12:16:35 -07:00
|
|
|
|
|
|
|
.. _exp-analysis-docstring:
|
|
|
|
|
2020-05-17 12:19:44 -07:00
|
|
|
ExperimentAnalysis (tune.ExperimentAnalysis)
|
|
|
|
--------------------------------------------
|
2020-03-23 12:23:21 -07:00
|
|
|
|
|
|
|
.. autoclass:: ray.tune.ExperimentAnalysis
|
|
|
|
:members:
|
2021-11-22 14:16:26 +00:00
|
|
|
|
|
|
|
TrialCheckpoint (tune.cloud.TrialCheckpoint)
|
|
|
|
--------------------------------------------
|
|
|
|
|
|
|
|
.. autoclass:: ray.tune.cloud.TrialCheckpoint
|
|
|
|
:members:
|