ray/doc/source/tune/api_docs/analysis.rst
Kai Fricke c0ec20dc3a
[tune] Next deprecation cycle (#24076)
Rolling out next deprecation cycle:

- DeprecationWarnings that were `warnings.warn` or `logger.warn` before are now raised errors
- Raised Deprecation warnings are now removed
- Notably, this involves deprecating the TrialCheckpoint functionality and associated cloud tests
- Added annotations to deprecation warning for when to fully remove
2022-04-26 09:30:15 +01:00

47 lines
1.3 KiB
ReStructuredText

.. _tune-analysis-docs:
Analysis (tune.analysis)
========================
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.results_df
# 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``.
This is also supported by the ``ExperimentAnalysis`` class.
.. code-block:: python
from ray.tune import ExperimentAnalysis
analysis = ExperimentAnalysis("~/ray_results/example-experiment")
.. _exp-analysis-docstring:
ExperimentAnalysis (tune.ExperimentAnalysis)
--------------------------------------------
.. autoclass:: ray.tune.ExperimentAnalysis
:members: