BenchmarkingResults#

class BenchmarkingResults(path: str, results: list[~sktime.benchmarking._benchmarking_dataclasses.ResultObject] = <factory>)[source]#

Utility for writing and loading benchmark results to and from disk.

BenchmarkingResults is the in-memory representation of a persisted benchmark results file. On construction it loads any data already stored at provided path — either from a completed output file or from crash-safe partial checkpoints left by an interrupted run ({path}.parts/).

The primary user-facing entry point is to_df, which returns the same flat summary table produced by BaseBenchmark.run().

For structured access to individual experiments, use the results attribute, which holds a list of ResultObject instances.

During benchmark runs, internally BaseBenchmark.run() uses BenchmarkingResults as a mutable container while experiments execute: it skips completed task-model pairs (checked using _contains), appends new results with incremental checkpointing (using _update), and writes the final output file (using _save). These methods are not part of the public API.

All file I/O is delegated to BenchmarkResultsPersistence.

Parameters:
pathstr or None

Path to the benchmark results file (e.g. "results.json"). Must refer to a file, not a directory; the file extension determines the final storage format (.json, .csv, or .parquet). When None, results are kept in memory only and no file I/O occurs.

resultslist of ResultObject, optional

In-memory result list. Overwritten on init by loading from persistence when saved data exists at path or in its checkpoint directory.

Examples

>>> from sktime.benchmarking import BenchmarkingResults
>>> df = BenchmarkingResults("results.csv").to_df()

Methods

to_df()

Convert in-memory results to a summary pandas DataFrame.

to_df()[source]#

Convert in-memory results to a summary pandas DataFrame.

Returns:
pandas.DataFrame

Aggregated benchmark metrics per task-model pair. Empty when no results are stored.