load_m4

datasets.load_m4()

Load the bundled M4 forecasting results table.

Reads M4_2018_by_frequency.csv from the installed package via importlib.resources. The long CSV has one row per method and frequency band with columns method, frequency, smape, mase, n_series. The loader reshapes it into a (25, 6, 2) method by frequency by metric tensor, with methods kept in competition rank order and frequencies ordered from yearly to hourly.

The table is a derived artefact, computed once from the GPL-3 M4comp2018 data (the top-25 methods’ point forecasts and the realized values) by src/beam/data/reduce_m4.R. See src/beam/data/README.md for the provenance, the metric definitions, and the validation against the published competition figures.

Returns

Type Description
M4Forecasting Frozen dataclass with method names, frequency names, the metric ids smape and mase, per-metric polarity, the (25, 6, 2) score tensor, and the per-frequency series counts.