get_dataframe#
- ResultGrid.get_dataframe(filter_metric: str | None = None, filter_mode: str | None = None) pandas.DataFrame[source]#
Return dataframe of all trials with their configs and reported results.
Per default, this returns the last reported results for each trial.
If
filter_metricandfilter_modeare set, the results from each trial are filtered for this metric and mode. For example, iffilter_metric="some_metric"andfilter_mode="max", for each trial, every received result is checked, and the one wheresome_metricis maximal is returned.Examples
>>> import ray.tune >>> def training_loop_per_worker(config): ... ray.tune.report({"accuracy": 0.8}) >>> print("[ignore]"); result_grid = ray.tune.Tuner( ... trainable=training_loop_per_worker, ... run_config=ray.tune.RunConfig(name="my_tune_run") ... ).fit() [ignore]... >>> # Get last reported results per trial >>> df = result_grid.get_dataframe() >>> # Get best ever reported accuracy per trial >>> df = result_grid.get_dataframe( ... filter_metric="accuracy", filter_mode="max" ... )
- Parameters:
- Returns:
Pandas DataFrame with each trial as a row and their results as columns.
- Return type: