ray/doc/source/tune/api_docs/analysis.rst
Richard Liaw b506f87117
[tune] New Doc edits, add Concepts page (#8083)
Co-Authored-By: Sven Mika <sven@anyscale.io>
2020-04-25 18:25:56 -07:00

56 lines
1.3 KiB
ReStructuredText

.. _tune-analysis-docs:
Analysis (tune.analysis)
========================
Analyzing Results
-----------------
You can use the ``ExperimentAnalysis`` object for analyzing results. It is returned automatically when calling ``tune.run``.
.. 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
df = analysis.dataframe()
# 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
You may want to get a summary of multiple experiments that point to the same ``local_dir``. For this, you can use the ``Analysis`` class.
.. code-block:: python
from ray.tune import Analysis
analysis = Analysis("~/ray_results/example-experiment")
.. _exp-analysis-docstring:
ExperimentAnalysis
~~~~~~~~~~~~~~~~~~
.. autoclass:: ray.tune.ExperimentAnalysis
:show-inheritance:
:members:
Analysis
~~~~~~~~
.. autoclass:: ray.tune.Analysis
:members: