Skip to content

Synthetic DGP Benchmark Suite

benchmarks

Synthetic Data-Generating Process (DGP) Benchmark Bank — pure, deterministic, zero GCP imports.

Provides 12 canonical time-series panels with known mathematical ground truth for validating, benchmarking, and evolving (auto_policy.py) the Glass-Box Auto-Forecaster (build_config, auto_forecast) and its closed-loop autofocus controller.

Why synthetic DGPs with known ground truth?

Real-world datasets are indispensable for systems scale testing, but their true data-generating process is unobserved: when a model wins or loses, you cannot prove why without controlled counterfactuals. Every benchmark in this module constructs both:

  1. Observed historical + future covariate panel (dataset.df) — the exact DataFrame handed to Forecaster.build_config() or Forecaster.auto(), including future covariate rows over the forecast horizon when exogenous drivers exist.
  2. Noise-free Oracle Conditional Expectation (dataset.oracle_future_df) — the exact mathematical expectation $\mu_{i, T+h} = \mathbb{E}[Y_{i, T+h} \mid \mathcal{F}_T]$ over the future horizon $h = 1 \dots H$, plus a structured :class:BenchmarkSpec declaring the true Syntetos–Boylan–Croston (SBC) demand regime, true vs. decoy covariates, true target transform, horizon crossover step $h^*$, structural breaks, stockout censoring, and whether Pass 1 is already statistically optimal (already_optimal_at_pass_1=True).

Public surface: BENCHMARK_NAMES, BenchmarkSpec, BenchmarkDataset, list_benchmarks, benchmark_catalog, load_benchmark.

BenchmarkDataset dataclass

BenchmarkDataset(spec, df, future_df, oracle_future_df)

A generated DGP benchmark panel paired with its ground-truth spec and oracle expectations.

Attributes:

Name Type Description
spec BenchmarkSpec

The :class:BenchmarkSpec describing the ground-truth DGP properties.

df DataFrame

Historical panel (ts_id, ds, y, plus any static/dynamic covariates).

future_df DataFrame

Future covariate rows over the forecast horizon (ts_id, ds, and dynamic covariates) when exogenous drivers exist, or an empty DataFrame for univariate panels.

oracle_future_df DataFrame

Exact noise-free conditional expectation (ts_id, ds, horizon_step, oracle_yhat, y_realized) over the forecast horizon $h = 1 \dots H$.

full_panel_with_future_covariates property

full_panel_with_future_covariates

Return historical rows concatenated with future covariate rows (y = NaN in future).

panel_df property

panel_df

Alias for self.df (the historical + exogenous panel DataFrame).

summary_dict

summary_dict()

Return a JSON-friendly summary of the benchmark spec and generated row counts.

Source code in src/scale_forecasting/benchmarks.py
def summary_dict(self) -> dict[str, Any]:
    """Return a JSON-friendly summary of the benchmark spec and generated row counts."""
    d = self.spec.to_dict()
    d["n_hist_rows"] = len(self.df)
    d["n_future_rows"] = len(self.future_df)
    d["n_oracle_rows"] = len(self.oracle_future_df)
    d["columns"] = list(self.df.columns)
    return d

BenchmarkSpec dataclass

BenchmarkSpec(
    name,
    title,
    description,
    freq,
    horizon,
    n_series,
    history_length,
    expected_regime,
    non_negative=True,
    integer_valued=False,
    heteroskedastic=False,
    true_transform="none",
    true_covariates=(),
    decoy_covariates=(),
    static_covariates=(),
    hierarchy_id_cols=(),
    censored_col=None,
    has_horizon_crossover=False,
    crossover_step=None,
    has_structural_break=False,
    has_anomalies=False,
    has_cold_start=False,
    needs_regime_routing=False,
    prefers_global_pooling=False,
    recommended_goal="accuracy",
    optimal_quantile=None,
    lead_time=None,
    already_optimal_at_pass_1=False,
    expected_autofocus_actions=(),
    seed=20261014,
)

Ground-truth mathematical specification for one canonical DGP benchmark panel.

to_dict

to_dict()

Serialize to a JSON-friendly dictionary.

Source code in src/scale_forecasting/benchmarks.py
def to_dict(self) -> dict[str, Any]:
    """Serialize to a JSON-friendly dictionary."""
    raw = asdict(self)
    for k, v in list(raw.items()):
        if isinstance(v, tuple):
            raw[k] = list(v)
    return raw

PublicBenchmarkSpec dataclass

PublicBenchmarkSpec(
    name,
    title,
    domain,
    freq,
    horizon,
    default_n_series,
    license,
    citation,
    homepage_url,
    source_urls,
    future_covariates=(),
    past_covariates=(),
    static_covariates=(),
    hierarchy_id_cols=(),
)

Metadata, citation, license, and source URLs for a public open-data benchmark.

Raw external datasets are never rehosted in this repository; fetch_public_benchmark downloads them on demand into an ephemeral local cache (/tmp/scale_forecasting_public_benchmarks) and converts them into a standard :class:BenchmarkDataset with held-out ground truth in oracle_future_df.

to_dict

to_dict()

Serialize to a JSON-friendly dictionary.

Source code in src/scale_forecasting/benchmarks.py
def to_dict(self) -> dict[str, Any]:
    """Serialize to a JSON-friendly dictionary."""
    raw = asdict(self)
    for k, v in list(raw.items()):
        if isinstance(v, tuple):
            raw[k] = list(v)
    return raw

benchmark_catalog

benchmark_catalog()

Return a summary DataFrame describing all 12 canonical DGP benchmark panels.

Source code in src/scale_forecasting/benchmarks.py
def benchmark_catalog() -> pd.DataFrame:
    """Return a summary DataFrame describing all 12 canonical DGP benchmark panels."""
    rows: list[dict[str, Any]] = []
    for name in BENCHMARK_NAMES:
        spec = _SPECS[name]
        rows.append(
            {
                "name": spec.name,
                "title": spec.title,
                "freq": spec.freq,
                "horizon": spec.horizon,
                "n_series": spec.n_series,
                "history_length": spec.history_length,
                "expected_regime": spec.expected_regime,
                "true_transform": spec.true_transform,
                "true_covariates": list(spec.true_covariates),
                "decoy_covariates": list(spec.decoy_covariates),
                "has_horizon_crossover": spec.has_horizon_crossover,
                "has_structural_break": spec.has_structural_break,
                "censored_col": spec.censored_col,
                "hierarchy_id_cols": list(spec.hierarchy_id_cols),
                "already_optimal_at_pass_1": spec.already_optimal_at_pass_1,
            }
        )
    return pd.DataFrame(rows)

fetch_public_benchmark

fetch_public_benchmark(
    name,
    *,
    n_series=None,
    history_limit=365,
    cache_dir=None,
)

Download and prepare a public real-world benchmark on demand (zero repo data rehosting).

Fetches official public files into cache_dir (default /tmp/scale_forecasting_public_benchmarks/<name>) and splits each series into historical observations (dataset.df), future exogenous covariates (dataset.future_df), and held-out ground-truth test actuals (dataset.oracle_future_df).

Source code in src/scale_forecasting/benchmarks.py
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
def fetch_public_benchmark(
    name: str,
    *,
    n_series: int | None = None,
    history_limit: int = 365,
    cache_dir: str | None = None,
) -> BenchmarkDataset:
    """Download and prepare a public real-world benchmark on demand (zero repo data rehosting).

    Fetches official public files into ``cache_dir`` (default
    ``/tmp/scale_forecasting_public_benchmarks/<name>``) and splits each series into historical
    observations (`dataset.df`), future exogenous covariates (`dataset.future_df`), and held-out
    ground-truth test actuals (`dataset.oracle_future_df`).
    """
    import csv
    import io
    import tempfile
    import urllib.request
    from pathlib import Path

    if name not in PUBLIC_BENCHMARK_SPECS:
        raise ValueError(
            f"Unknown public benchmark {name!r}; expected one of {PUBLIC_BENCHMARK_NAMES}"
        )
    pub_spec = PUBLIC_BENCHMARK_SPECS[name]
    eff_n = int(n_series or pub_spec.default_n_series)
    h = pub_spec.horizon
    default_cache = Path(tempfile.gettempdir()) / "scale_forecasting_public_benchmarks"
    root = Path(cache_dir or default_cache) / name
    root.mkdir(parents=True, exist_ok=True)

    # 1. Monash Archive (.tsf inside .zip on Zenodo)
    if name.startswith("monash_"):
        zip_bytes = _download_cached_bytes(pub_spec.source_urls[0], root / f"{name}.zip")
        return _parse_monash_tsf_zip(
            zip_bytes, pub_spec=pub_spec, n_series=eff_n, history_limit=history_limit
        )

    # 2. ETTh1 (zhouhaoyi/ETDataset on GitHub)
    if name == "etth1":
        csv_bytes = _download_cached_bytes(pub_spec.source_urls[0], root / "ETTh1.csv")
        raw_df = pd.read_csv(io.BytesIO(csv_bytes))
        raw_df["date"] = pd.to_datetime(raw_df["date"])
        raw_df = raw_df.tail(history_limit + h).reset_index(drop=True)
        series_cols = [c for c in raw_df.columns if c != "date"][:eff_n]
        hist_frames: list[pd.DataFrame] = []
        oracle_frames: list[pd.DataFrame] = []
        for col in series_cols:
            vals = pd.to_numeric(raw_df[col], errors="coerce").to_numpy(dtype=np.float64)
            dates = raw_df["date"]
            hist_frames.append(
                pd.DataFrame({"ts_id": col, "ds": dates.iloc[:-h], "y": np.round(vals[:-h], 4)})
            )
            oracle_frames.append(
                pd.DataFrame(
                    {
                        "ts_id": col,
                        "ds": dates.iloc[-h:].to_numpy(),
                        "horizon_step": np.arange(1, h + 1, dtype=np.int64),
                        "oracle_yhat": np.round(vals[-h:], 4),
                        "y_realized": np.round(vals[-h:], 4),
                    }
                )
            )
        df = pd.concat(hist_frames, ignore_index=True)
        oracle_df = pd.concat(oracle_frames, ignore_index=True)
        spec = BenchmarkSpec(
            name=name,
            title=pub_spec.title,
            description=f"{pub_spec.citation} ({pub_spec.license})",
            freq=pub_spec.freq,
            horizon=h,
            n_series=len(series_cols),
            history_length=history_limit,
            expected_regime="erratic",
            non_negative=False,
        )
        return BenchmarkDataset(
            spec=spec, df=df, future_df=pd.DataFrame(), oracle_future_df=oracle_df
        )

    # 3. M4 Competition (Daily, Weekly, Monthly from Mcompetitions/M4-methods)
    if name.startswith("m4_"):
        train_url, test_url = pub_spec.source_urls
        train_cache = root / f"{name}_train_subset.csv"
        test_cache = root / f"{name}_test_subset.csv"
        if not train_cache.is_file() or not test_cache.is_file():
            for url, out_path in ((train_url, train_cache), (test_url, test_cache)):
                req = urllib.request.Request(url, headers={"User-Agent": "scale-forecasting/1.2"})
                with urllib.request.urlopen(req, timeout=60) as resp:
                    lines_collected: list[str] = []
                    for raw_line in resp:
                        lines_collected.append(raw_line.decode("utf-8", errors="ignore"))
                        if len(lines_collected) >= max(eff_n + 5, 105):
                            break
                out_path.write_text("".join(lines_collected), encoding="utf-8")

        hist_frames = []
        oracle_frames = []
        with (
            train_cache.open("r", encoding="utf-8") as f_tr,
            test_cache.open("r", encoding="utf-8") as f_te,
        ):
            r_tr = csv.reader(f_tr)
            r_te = csv.reader(f_te)
            next(r_tr, None)
            next(r_te, None)
            for idx, (row_tr, row_te) in enumerate(zip(r_tr, r_te, strict=False)):
                if idx >= eff_n:
                    break
                ts_id = row_tr[0].strip()
                tr_vals = [float(v) for v in row_tr[1:] if v.strip()]
                te_vals = [float(v) for v in row_te[1 : h + 1] if v.strip()]
                if len(te_vals) < h or len(tr_vals) < 20:
                    continue
                tr_vals = tr_vals[-history_limit:]
                total_len = len(tr_vals) + h
                m4_dates = pd.date_range("2015-01-01", periods=total_len, freq=pub_spec.freq)
                hist_frames.append(
                    pd.DataFrame(
                        {
                            "ts_id": ts_id,
                            "ds": m4_dates[:-h],
                            "y": np.round(np.asarray(tr_vals, dtype=np.float64), 4),
                        }
                    )
                )
                oracle_frames.append(
                    pd.DataFrame(
                        {
                            "ts_id": ts_id,
                            "ds": m4_dates[-h:],
                            "horizon_step": np.arange(1, h + 1, dtype=np.int64),
                            "oracle_yhat": np.round(np.asarray(te_vals, dtype=np.float64), 4),
                            "y_realized": np.round(np.asarray(te_vals, dtype=np.float64), 4),
                        }
                    )
                )
        df = pd.concat(hist_frames, ignore_index=True)
        oracle_df = pd.concat(oracle_frames, ignore_index=True)
        spec = BenchmarkSpec(
            name=name,
            title=pub_spec.title,
            description=f"{pub_spec.citation} ({pub_spec.license})",
            freq=pub_spec.freq,
            horizon=h,
            n_series=len(hist_frames),
            history_length=int(len(df) // max(1, len(hist_frames))),
            expected_regime="smooth",
            non_negative=True,
        )
        return BenchmarkDataset(
            spec=spec, df=df, future_df=pd.DataFrame(), oracle_future_df=oracle_df
        )

    # 4. M5 Walmart Hierarchical Retail (calendar + sales_train_evaluation + sell_prices)
    if name == "m5_walmart":
        cal_url, eval_url, price_url = pub_spec.source_urls
        cal_bytes = _download_cached_bytes(cal_url, root / "calendar.csv")
        cal_df = pd.read_csv(io.BytesIO(cal_bytes))
        cal_df["ds"] = pd.to_datetime(cal_df["date"])
        cal_df["is_event"] = cal_df["event_name_1"].notna().astype(np.int64)

        eval_path = root / "sales_train_evaluation.csv"
        if not eval_path.is_file() or eval_path.stat().st_size == 0:
            _download_cached_bytes(eval_url, eval_path)
        price_path = root / "sell_prices.csv"
        if not price_path.is_file() or price_path.stat().st_size == 0:
            _download_cached_bytes(price_url, price_path)

        # Stratified selection across CA_1, CA_2, TX_1, WI_1 and FOODS, HOUSEHOLD, HOBBIES
        sales_df = pd.read_csv(eval_path)
        d_cols = [c for c in sales_df.columns if c.startswith("d_")][-(history_limit + h) :]
        sales_df["_total_vol"] = sales_df[d_cols[-90:]].sum(axis=1)
        active_df = sales_df[sales_df["_total_vol"] >= 30].copy()
        per_group = max(1, math.ceil(eff_n / 6))
        picked_rows = (
            active_df.sort_values("_total_vol", ascending=False)
            .groupby(["state_id", "cat_id"], as_index=False)
            .head(per_group)
            .head(eff_n)
        )
        wanted_pairs = set(zip(picked_rows["store_id"], picked_rows["item_id"], strict=False))

        # Filter sell_prices for selected (store_id, item_id) pairs
        price_chunks: list[pd.DataFrame] = []
        for chunk in pd.read_csv(price_path, chunksize=250_000):
            mask = chunk["store_id"].isin(picked_rows["store_id"].unique()) & chunk["item_id"].isin(
                picked_rows["item_id"].unique()
            )
            if mask.any():
                price_chunks.append(chunk.loc[mask])
        prices_sub = (
            pd.concat(price_chunks, ignore_index=True)
            if price_chunks
            else pd.DataFrame(columns=["store_id", "item_id", "wm_yr_wk", "sell_price"])
        )
        _ = wanted_pairs

        cal_sub = cal_df[
            ["d", "ds", "wm_yr_wk", "is_event", "snap_CA", "snap_TX", "snap_WI"]
        ].set_index("d")

        hist_frames = []
        fut_frames: list[pd.DataFrame] = []
        oracle_frames = []
        for _, srow in picked_rows.iterrows():
            ts_id = str(srow["id"]).replace("_evaluation", "")
            state_id = str(srow["state_id"])
            store_id = str(srow["store_id"])
            cat_id = str(srow["cat_id"])
            dept_id = str(srow["dept_id"])
            item_id = str(srow["item_id"])
            snap_col = f"snap_{state_id}" if f"snap_{state_id}" in cal_sub.columns else "snap_CA"

            s_cal = cal_sub.loc[d_cols].copy()
            s_cal["y"] = srow[d_cols].to_numpy(dtype=np.float64)
            s_cal["snap_active"] = s_cal[snap_col].to_numpy(dtype=np.int64)
            item_prices = prices_sub[
                (prices_sub["store_id"] == store_id) & (prices_sub["item_id"] == item_id)
            ][["wm_yr_wk", "sell_price"]].drop_duplicates("wm_yr_wk")
            s_cal = s_cal.merge(item_prices, on="wm_yr_wk", how="left")
            s_cal["sell_price"] = s_cal["sell_price"].ffill().bfill().fillna(1.0)
            s_cal["ts_id"] = ts_id
            s_cal["state_id"] = state_id
            s_cal["store_id"] = store_id
            s_cal["cat_id"] = cat_id
            s_cal["dept_id"] = dept_id

            cols_keep = [
                "ts_id",
                "ds",
                "y",
                "snap_active",
                "is_event",
                "sell_price",
                "state_id",
                "store_id",
                "cat_id",
                "dept_id",
            ]
            hist_part = s_cal.iloc[:-h][cols_keep].copy()
            test_part = s_cal.iloc[-h:].copy()
            hist_frames.append(hist_part)
            fut_frames.append(
                test_part[["ts_id", "ds", "snap_active", "is_event", "sell_price"]].copy()
            )
            oracle_frames.append(
                pd.DataFrame(
                    {
                        "ts_id": ts_id,
                        "ds": test_part["ds"].to_numpy(),
                        "horizon_step": np.arange(1, h + 1, dtype=np.int64),
                        "oracle_yhat": np.round(test_part["y"].to_numpy(dtype=np.float64), 4),
                        "y_realized": np.round(test_part["y"].to_numpy(dtype=np.float64), 4),
                    }
                )
            )
        df = pd.concat(hist_frames, ignore_index=True)
        fut_df = pd.concat(fut_frames, ignore_index=True)
        oracle_df = pd.concat(oracle_frames, ignore_index=True)
        spec = BenchmarkSpec(
            name=name,
            title=pub_spec.title,
            description=f"{pub_spec.citation} ({pub_spec.license})",
            freq=pub_spec.freq,
            horizon=h,
            n_series=len(hist_frames),
            history_length=history_limit,
            expected_regime="smooth",
            non_negative=True,
            integer_valued=True,
            true_covariates=pub_spec.future_covariates,
            static_covariates=pub_spec.static_covariates,
            hierarchy_id_cols=pub_spec.hierarchy_id_cols,
        )
        return BenchmarkDataset(spec=spec, df=df, future_df=fut_df, oracle_future_df=oracle_df)

    # 5. Corporación Favorita Grocery Sales (train + stores + oil + holidays_events)
    train_url, stores_url, oil_url, hol_url = pub_spec.source_urls
    stores_df = pd.read_csv(io.BytesIO(_download_cached_bytes(stores_url, root / "stores.csv")))
    oil_df = pd.read_csv(io.BytesIO(_download_cached_bytes(oil_url, root / "oil.csv")))
    hol_df = pd.read_csv(io.BytesIO(_download_cached_bytes(hol_url, root / "holidays_events.csv")))

    train_path = root / "train.csv"
    if not train_path.is_file() or train_path.stat().st_size == 0:
        _download_cached_bytes(train_url, train_path)

    target_stores = [1, 2, 3, 44, 45, 47, 48, 49]
    target_families = [
        "GROCERY I",
        "BEVERAGES",
        "PRODUCE",
        "CLEANING",
        "DAIRY",
        "BREAD/BAKERY",
    ]
    sub_chunks: list[pd.DataFrame] = []
    for chunk in pd.read_csv(
        train_path,
        usecols=["date", "store_nbr", "family", "sales", "onpromotion"],
        chunksize=500_000,
    ):
        m = (
            chunk["store_nbr"].isin(target_stores)
            & chunk["family"].isin(target_families)
            & (chunk["date"] >= "2016-06-01")
        )
        if m.any():
            sub_chunks.append(chunk.loc[m])
    raw_fav = pd.concat(sub_chunks, ignore_index=True)
    raw_fav["ds"] = pd.to_datetime(raw_fav["date"])
    oil_df["ds"] = pd.to_datetime(oil_df["date"])
    oil_sub = oil_df[["ds", "dcoilwtico"]].drop_duplicates("ds").sort_values("ds")
    oil_sub["dcoilwtico"] = oil_sub["dcoilwtico"].ffill().bfill().fillna(45.0)

    hol_df["ds"] = pd.to_datetime(hol_df["date"])
    nat_hols = set(
        hol_df.loc[hol_df["transferred"].fillna(False) == False, "ds"].unique()  # noqa: E712
    )

    raw_fav = raw_fav.merge(stores_df[["store_nbr", "city", "state"]], on="store_nbr", how="left")
    raw_fav = raw_fav.merge(oil_sub, on="ds", how="left")
    raw_fav["dcoilwtico"] = raw_fav["dcoilwtico"].ffill().bfill().fillna(45.0)
    raw_fav["is_holiday"] = raw_fav["ds"].isin(nat_hols).astype(np.int64)
    raw_fav["store_id"] = "store_" + raw_fav["store_nbr"].astype(str)
    raw_fav["ts_id"] = (
        raw_fav["store_id"] + "__" + raw_fav["family"].str.replace(" ", "_").str.replace("/", "_")
    )

    unique_ids = sorted(raw_fav["ts_id"].unique())[:eff_n]
    raw_fav = raw_fav[raw_fav["ts_id"].isin(unique_ids)].sort_values(["ts_id", "ds"])

    hist_frames = []
    fut_frames = []
    oracle_frames = []
    for raw_tid, grp in raw_fav.groupby("ts_id", sort=False):
        ts_id = str(raw_tid)
        g = grp.tail(history_limit + h).copy()
        if len(g) < h + 30:
            continue
        g["y"] = np.round(pd.to_numeric(g["sales"], errors="coerce").fillna(0.0).to_numpy(), 4)
        g["onpromotion"] = pd.to_numeric(g["onpromotion"], errors="coerce").fillna(0.0).to_numpy()
        cols_keep = [
            "ts_id",
            "ds",
            "y",
            "onpromotion",
            "is_holiday",
            "dcoilwtico",
            "state",
            "city",
            "store_id",
            "family",
        ]
        hist_part = g.iloc[:-h][cols_keep].copy()
        test_part = g.iloc[-h:].copy()
        hist_frames.append(hist_part)
        fut_frames.append(test_part[["ts_id", "ds", "onpromotion", "is_holiday"]].copy())
        oracle_frames.append(
            pd.DataFrame(
                {
                    "ts_id": str(ts_id),
                    "ds": test_part["ds"].to_numpy(),
                    "horizon_step": np.arange(1, h + 1, dtype=np.int64),
                    "oracle_yhat": np.round(test_part["y"].to_numpy(dtype=np.float64), 4),
                    "y_realized": np.round(test_part["y"].to_numpy(dtype=np.float64), 4),
                }
            )
        )

    df = pd.concat(hist_frames, ignore_index=True)
    fut_df = pd.concat(fut_frames, ignore_index=True)
    oracle_df = pd.concat(oracle_frames, ignore_index=True)
    spec = BenchmarkSpec(
        name=name,
        title=pub_spec.title,
        description=f"{pub_spec.citation} ({pub_spec.license})",
        freq=pub_spec.freq,
        horizon=h,
        n_series=len(hist_frames),
        history_length=int(len(df) // max(1, len(hist_frames))),
        expected_regime="smooth",
        non_negative=True,
        true_covariates=pub_spec.future_covariates,
        static_covariates=pub_spec.static_covariates,
        hierarchy_id_cols=pub_spec.hierarchy_id_cols,
    )
    return BenchmarkDataset(spec=spec, df=df, future_df=fut_df, oracle_future_df=oracle_df)

list_benchmarks

list_benchmarks()

Return the sorted names of all 12 canonical DGP benchmark panels.

Source code in src/scale_forecasting/benchmarks.py
def list_benchmarks() -> list[str]:
    """Return the sorted names of all 12 canonical DGP benchmark panels."""
    return list(BENCHMARK_NAMES)

list_public_benchmarks

list_public_benchmarks()

Return all registered public open-data benchmark names.

Source code in src/scale_forecasting/benchmarks.py
def list_public_benchmarks() -> list[str]:
    """Return all registered public open-data benchmark names."""
    return list(PUBLIC_BENCHMARK_NAMES)

load_benchmark

load_benchmark(
    name,
    *,
    n_series=None,
    history_length=None,
    horizon=None,
    seed=None,
)

Deterministically generate one canonical DGP benchmark dataset by name.

Parameters:

Name Type Description Default
name str

Benchmark identifier in :data:BENCHMARK_NAMES.

required
n_series int | None

Optional override for number of series in the panel.

None
history_length int | None

Optional override for historical observations per series.

None
horizon int | None

Optional override for forecast horizon steps.

None
seed int | None

Optional override for random number generator seed.

None

Returns:

Type Description
BenchmarkDataset

class:BenchmarkDataset containing .spec, .df, .future_df, and .oracle_future_df.

Source code in src/scale_forecasting/benchmarks.py
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
def load_benchmark(
    name: str,
    *,
    n_series: int | None = None,
    history_length: int | None = None,
    horizon: int | None = None,
    seed: int | None = None,
) -> BenchmarkDataset:
    """Deterministically generate one canonical DGP benchmark dataset by name.

    Args:
        name: Benchmark identifier in :data:`BENCHMARK_NAMES`.
        n_series: Optional override for number of series in the panel.
        history_length: Optional override for historical observations per series.
        horizon: Optional override for forecast horizon steps.
        seed: Optional override for random number generator seed.

    Returns:
        :class:`BenchmarkDataset` containing `.spec`, `.df`, `.future_df`, and `.oracle_future_df`.
    """
    if name not in _SPECS:
        valid = ", ".join(BENCHMARK_NAMES)
        raise ValueError(f"Unknown benchmark '{name}'. Valid benchmarks: {valid}")
    base_spec = _SPECS[name]
    eff_n = int(n_series if n_series is not None else base_spec.n_series)
    eff_t = int(history_length if history_length is not None else base_spec.history_length)
    eff_h = int(horizon if horizon is not None else base_spec.horizon)
    eff_seed = int(seed if seed is not None else base_spec.seed)
    spec = BenchmarkSpec(
        **{
            **asdict(base_spec),
            "n_series": eff_n,
            "history_length": eff_t,
            "horizon": eff_h,
            "seed": eff_seed,
        }
    )
    rng = np.random.default_rng(eff_seed)
    total_len = eff_t + eff_h
    dates = pd.date_range("2025-01-01", periods=total_len, freq=spec.freq)
    t_idx = np.arange(total_len, dtype=np.float64)

    hist_rows: list[pd.DataFrame] = []
    fut_rows: list[pd.DataFrame] = []
    oracle_rows: list[pd.DataFrame] = []

    for i in range(eff_n):
        ts_id = f"series_{i + 1:03d}"
        phase = float(rng.uniform(0.0, 2.0 * np.pi))
        weekly = np.sin(2.0 * np.pi * t_idx / 7.0 + phase) + 0.35 * np.cos(
            4.0 * np.pi * t_idx / 7.0 + phase
        )
        extra_cols: dict[str, np.ndarray | list[Any]] = {}
        start_idx = 0

        if name == "dgp_01_smooth_seasonal":
            base_level = float(rng.uniform(80.0, 160.0))
            slope = float(rng.uniform(0.15, 0.45))
            amp = 0.18 * base_level
            mu = np.maximum(1.0, base_level + slope * t_idx + amp * weekly)
            noise = rng.normal(0.0, 0.04 * base_level, size=total_len)
            y_all = np.maximum(0.0, mu + noise)

        elif name == "dgp_02_multiplicative_log":
            log_base = float(rng.uniform(3.2, 4.0))
            log_slope = float(rng.uniform(0.014, 0.021))
            log_season = 0.38 * np.sin(2.0 * np.pi * t_idx / 7.0 + phase)
            sigma = 0.14
            eps = rng.normal(0.0, sigma, size=total_len)
            log_mu = log_base + log_slope * t_idx + log_season
            # Conditional expectation of exp(log_mu + eps) - 1 under log-normal shocks
            mu = np.maximum(0.0, np.expm1(log_mu + 0.5 * sigma**2))
            y_all = np.maximum(0.0, np.expm1(log_mu + eps))

        elif name == "dgp_03_intermittent_lumpy":
            is_sparse = i < round(0.65 * eff_n)
            if is_sparse:
                p_demand = float(rng.uniform(0.22, 0.38))
                mean_size = float(rng.uniform(4.0, 14.0))
                occ = rng.binomial(1, p_demand, size=total_len)
                sizes = rng.poisson(lam=mean_size, size=total_len) + 1
                mu = np.full(total_len, p_demand * (mean_size + 1.0), dtype=np.float64)
                y_all = (occ * sizes).astype(np.float64)
            else:
                lam = float(rng.uniform(12.0, 28.0))
                mu = np.maximum(1.0, lam + 3.5 * np.sin(2.0 * np.pi * t_idx / 7.0 + phase))
                y_all = rng.poisson(lam=mu).astype(np.float64)

        elif name == "dgp_04_true_vs_decoy_covs":
            base_level = float(rng.uniform(90.0, 140.0))
            promo_depth = (
                (rng.uniform(0.0, 1.0, size=total_len) < 0.25)
                * rng.uniform(0.15, 0.45, size=total_len)
            ).round(3)
            price_index = np.clip(
                1.0 + np.cumsum(rng.normal(0.0, 0.015, size=total_len)), 0.75, 1.30
            ).round(3)
            noise_a = rng.normal(0.0, 1.0, size=total_len).round(3)
            noise_b = np.cumsum(rng.normal(0.0, 0.2, size=total_len)).round(3)
            noise_c = rng.uniform(-1.0, 1.0, size=total_len).round(3)

            mu = np.maximum(
                5.0,
                base_level
                + 0.12 * t_idx
                + 14.0 * weekly
                + 85.0 * promo_depth
                - 55.0 * (price_index - 1.0),
            )
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 3.2, size=total_len))
            extra_cols = {
                "promo_depth": promo_depth,
                "price_index": price_index,
                "noise_a": noise_a,
                "noise_b": noise_b,
                "noise_c": noise_c,
            }

        elif name == "dgp_05_horizon_crossover":
            base_level = float(rng.uniform(100.0, 150.0))
            promo_flag = (rng.uniform(0.0, 1.0, size=total_len) < 0.22).astype(np.float64)
            det_signal = base_level + 22.0 * weekly + 48.0 * promo_flag
            # AR(1) shock with phi = 0.78 dominates steps 1..5, then decays into det_signal
            phi = 0.78
            ar_shock = np.zeros(total_len, dtype=np.float64)
            innov = rng.normal(0.0, 11.0, size=total_len)
            for t in range(1, total_len):
                ar_shock[t] = phi * ar_shock[t - 1] + innov[t]
            # Force a meaningful end-of-history shock so the horizon crossover is sharp
            ar_shock[eff_t - 1] = float(rng.choice([-1.0, 1.0]) * rng.uniform(28.0, 42.0))
            for h_idx in range(eff_h):
                t = eff_t + h_idx
                ar_shock[t] = phi * ar_shock[t - 1] + innov[t]
            y_all = np.maximum(1.0, det_signal + ar_shock)
            mu = det_signal.copy()
            last_shock = ar_shock[eff_t - 1]
            for h_idx in range(eff_h):
                mu[eff_t + h_idx] = max(
                    1.0, det_signal[eff_t + h_idx] + (phi ** (h_idx + 1)) * last_shock
                )
            extra_cols = {"promo_flag": promo_flag}

        elif name == "dgp_06_structural_break_spikes":
            base_level = float(rng.uniform(75.0, 125.0))
            break_idx = int(0.65 * eff_t)
            step_shift = np.where(t_idx >= break_idx, 0.65 * base_level, 0.0)
            mu = np.maximum(5.0, base_level + 0.08 * t_idx + step_shift + 12.0 * weekly)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 3.0, size=total_len))
            # Inject 3 isolated historical anomalous spikes (never in future horizon)
            spike_positions = [int(0.20 * eff_t), int(0.45 * eff_t), int(0.82 * eff_t)]
            for pos in spike_positions:
                if 0 <= pos < eff_t:
                    y_all[pos] += 1.65 * base_level

        elif name == "dgp_07_censored_stockouts":
            base_level = float(rng.uniform(95.0, 135.0))
            promo_flag = (rng.uniform(0.0, 1.0, size=total_len) < 0.20).astype(np.float64)
            mu = np.maximum(10.0, base_level + 0.15 * t_idx + 16.0 * weekly + 45.0 * promo_flag)
            latent_y = np.maximum(0.0, mu + rng.normal(0.0, 3.5, size=total_len))
            # Stockouts occur on ~18% of historical dates where demand is clipped by 45%
            stockout_flag = np.zeros(total_len, dtype=np.int64)
            hist_mask = rng.uniform(0.0, 1.0, size=eff_t) < 0.18
            stockout_flag[:eff_t] = hist_mask.astype(np.int64)
            y_all = latent_y.copy()
            y_all[:eff_t] = np.where(hist_mask, 0.52 * latent_y[:eff_t], latent_y[:eff_t])
            extra_cols = {
                "promo_flag": promo_flag,
                "stockout_flag": stockout_flag,
            }

        elif name == "dgp_08_hierarchical_nonneg":
            region_idx = i // 4
            store_idx = i % 4
            region_name = f"region_{region_idx + 1}"
            store_name = f"store_{region_idx + 1}_{store_idx + 1}"
            ts_id = f"{region_name}__{store_name}"
            base_level = float(rng.uniform(18.0, 55.0))
            region_wave = 8.0 * np.sin(2.0 * np.pi * t_idx / 7.0 + 0.5 * region_idx)
            mu = np.maximum(1.5, base_level + 0.06 * t_idx + region_wave)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 2.2, size=total_len))
            extra_cols = {
                "region": [region_name] * total_len,
                "store": [store_name] * total_len,
            }

        elif name == "dgp_09_cross_series_global":
            category = "cat_a" if i % 2 == 0 else "cat_b"
            store_tier = "tier_1" if i < eff_n // 2 else "tier_2"
            cat_mult = 1.25 if category == "cat_a" else 0.85
            tier_base = 120.0 if store_tier == "tier_1" else 75.0
            promo_depth = (
                (rng.uniform(0.0, 1.0, size=total_len) < 0.25)
                * rng.uniform(0.10, 0.40, size=total_len)
            ).round(3)
            price_index = np.clip(
                1.0 + np.cumsum(rng.normal(0.0, 0.012, size=total_len)), 0.80, 1.25
            ).round(3)
            shared_wave = 15.0 * np.sin(2.0 * np.pi * t_idx / 7.0)
            # Shared cross-series elasticity law
            mu = np.maximum(
                5.0,
                tier_base
                + cat_mult
                * (shared_wave + 95.0 * promo_depth - 65.0 * (price_index - 1.0) + 0.10 * t_idx),
            )
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 4.0, size=total_len))
            extra_cols = {
                "promo_depth": promo_depth,
                "price_index": price_index,
                "category": [category] * total_len,
                "store_tier": [store_tier] * total_len,
            }

        elif name == "dgp_10_newsvendor_service":
            base_level = float(rng.uniform(60.0, 110.0))
            mu = np.maximum(5.0, base_level + 0.10 * t_idx + 11.0 * weekly)
            sigma = 0.12 * base_level
            y_all = np.maximum(0.0, mu + rng.normal(0.0, sigma, size=total_len))

        elif name == "dgp_11_cold_start_mixed":
            is_cold = i >= round(0.75 * eff_n)
            start_idx = max(0, eff_t - 21) if is_cold else 0
            base_level = float(rng.uniform(70.0, 130.0))
            mu = np.maximum(5.0, base_level + 0.12 * t_idx + 13.0 * weekly)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 3.0, size=total_len))

        elif name == "dgp_12_already_optimal_white_noise":
            base_level = float(rng.uniform(95.0, 115.0))
            # Pure stationary mean + exact 7-day cycle + irreducible white noise (no trend/covs)
            mu = base_level + 9.0 * np.sin(2.0 * np.pi * t_idx / 7.0 + phase)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 2.0, size=total_len))

        elif name == "dgp_13_all_decoy_univariate_wins":
            base_level = float(rng.uniform(90.0, 130.0))
            noise_a = rng.normal(0.0, 1.0, size=total_len).round(3)
            noise_b = rng.uniform(-1.0, 1.0, size=total_len).round(3)
            noise_c = rng.normal(0.0, 2.0, size=total_len).round(3)
            mu = np.maximum(5.0, base_level + 0.14 * t_idx + 15.0 * weekly)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 2.5, size=total_len))
            extra_cols = {
                "noise_a": noise_a,
                "noise_b": noise_b,
                "noise_c": noise_c,
            }

        elif name == "dgp_14_large_hierarchy_intermittent_leaves":
            region_idx = i // 4
            store_idx = i % 4
            region_name = f"region_{region_idx + 1}"
            store_name = f"store_{region_idx + 1}_{store_idx + 1}"
            ts_id = f"{region_name}__{store_name}"
            p_demand = float(rng.uniform(0.28, 0.45))
            mean_size = float(rng.uniform(5.0, 12.0))
            occ = rng.binomial(1, p_demand, size=total_len)
            sizes = rng.poisson(lam=mean_size, size=total_len) + 1
            mu = np.full(total_len, p_demand * (mean_size + 1.0), dtype=np.float64)
            y_all = (occ * sizes).astype(np.float64)
            extra_cols = {
                "region": [region_name] * total_len,
                "store": [store_name] * total_len,
            }

        elif name == "dgp_15_scale_crossover_panel":
            scale_mult = float(rng.uniform(0.75, 1.35))
            common_wave = 18.0 * np.sin(2.0 * np.pi * t_idx / 7.0) + 6.0 * np.cos(
                4.0 * np.pi * t_idx / 7.0
            )
            mu = np.maximum(5.0, scale_mult * (100.0 + 0.18 * t_idx + common_wave))
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 2.8, size=total_len))

        elif name == "dgp_16_monthly_trading_days":
            # Monthly series where business days per month drive volume
            days_in_month = dates.days_in_month.to_numpy(dtype=np.float64)
            base_daily = float(rng.uniform(3.5, 6.0))
            yearly_wave = 0.45 * np.sin(2.0 * np.pi * t_idx / 12.0 + phase)
            mu = np.maximum(10.0, days_in_month * (base_daily + 0.03 * t_idx + yearly_wave))
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 2.0, size=total_len))

        elif name == "dgp_17_missing_gaps_and_leading_zeros":
            base_level = float(rng.uniform(85.0, 130.0))
            mu = np.maximum(5.0, base_level + 0.15 * t_idx + 14.0 * weekly)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 2.5, size=total_len))
            if i < max(1, eff_n // 2):
                # Inject 24 pre-launch leading zeros at start of history
                lead_z = min(24, max(6, eff_t // 5))
                y_all[:lead_z] = 0.0

        elif name == "dgp_18_promo_lag_pullforward":
            base_level = float(rng.uniform(100.0, 140.0))
            promo_flag = np.zeros(total_len, dtype=np.float64)
            for t_p in range(5, total_len, 9):
                promo_flag[t_p] = 1.0
            promo_lag1 = np.concatenate([[0.0], promo_flag[:-1]])
            mu = np.maximum(
                5.0,
                base_level + 0.10 * t_idx + 12.0 * weekly + 85.0 * promo_flag - 58.0 * promo_lag1,
            )
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 2.2, size=total_len))
            extra_cols = {"promo_flag": promo_flag}

        elif name == "dgp_19_hourly_diurnal_weekly_load":
            base_level = float(rng.uniform(220.0, 340.0))
            diurnal = 42.0 * np.sin(2.0 * np.pi * t_idx / 24.0 + phase) + 18.0 * np.cos(
                4.0 * np.pi * t_idx / 24.0 + phase
            )
            weekly_168 = 26.0 * np.sin(2.0 * np.pi * t_idx / 168.0) - 14.0 * np.cos(
                2.0 * np.pi * t_idx / 168.0
            )
            ambient_temp = np.round(
                22.0
                + 7.5 * np.sin(2.0 * np.pi * (t_idx - 6.0) / 24.0)
                + rng.normal(0.0, 0.9, size=total_len),
                2,
            )
            cooling_load = 4.2 * np.maximum(0.0, ambient_temp - 20.0)
            mu = np.maximum(20.0, base_level + 0.04 * t_idx + diurnal + weekly_168 + cooling_load)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 3.8, size=total_len))
            extra_cols = {"ambient_temp": ambient_temp}

        else:  # dgp_20_monthly_regime_drift_damped
            base_level = float(rng.uniform(140.0, 220.0))
            annual = 32.0 * np.sin(2.0 * np.pi * t_idx / 12.0 + phase) + 11.0 * np.cos(
                4.0 * np.pi * t_idx / 12.0 + phase
            )
            break_t = max(18, round(0.55 * eff_t))
            regime_shift = np.where(t_idx >= break_t, 48.0, 0.0)
            # Damped trend after cutoff so naive linear extrapolation overshoots long horizons
            damped_trend = np.where(
                t_idx < eff_t,
                1.15 * t_idx,
                1.15 * eff_t + 0.45 * (t_idx - eff_t),
            )
            mu = np.maximum(15.0, base_level + damped_trend + regime_shift + annual)
            y_all = np.maximum(0.0, mu + rng.normal(0.0, 3.2, size=total_len))

        hist_slice = slice(start_idx, eff_t)
        fut_slice = slice(eff_t, total_len)

        h_df = pd.DataFrame(
            {
                "ts_id": ts_id,
                "ds": dates[hist_slice],
                "y": np.round(y_all[hist_slice], 4),
            }
        )
        for col_name, col_vals in extra_cols.items():
            arr = np.asarray(col_vals)
            h_df[col_name] = arr[hist_slice]
        if (
            name == "dgp_17_missing_gaps_and_leading_zeros"
            and i < max(1, eff_n // 2)
            and len(h_df) > 50
        ):
            # Drop 2 interior timestamps to simulate missing date gaps
            h_df = h_df.drop(index=[35, 70]).reset_index(drop=True)
        hist_rows.append(h_df)

        if extra_cols:
            f_df = pd.DataFrame(
                {
                    "ts_id": ts_id,
                    "ds": dates[fut_slice],
                }
            )
            for col_name, col_vals in extra_cols.items():
                arr = np.asarray(col_vals)
                if col_name == spec.censored_col:
                    # Future dates are uncensored
                    f_df[col_name] = np.zeros(eff_h, dtype=np.int64)
                else:
                    f_df[col_name] = arr[fut_slice]
            fut_rows.append(f_df)

        o_df = pd.DataFrame(
            {
                "ts_id": ts_id,
                "ds": dates[fut_slice],
                "horizon_step": np.arange(1, eff_h + 1, dtype=np.int64),
                "oracle_yhat": np.round(mu[fut_slice], 4),
                "y_realized": np.round(y_all[fut_slice], 4),
            }
        )
        oracle_rows.append(o_df)

    df = pd.concat(hist_rows, ignore_index=True)
    future_df = pd.concat(fut_rows, ignore_index=True) if fut_rows else pd.DataFrame()
    oracle_future_df = pd.concat(oracle_rows, ignore_index=True)
    return BenchmarkDataset(
        spec=spec,
        df=df,
        future_df=future_df,
        oracle_future_df=oracle_future_df,
    )

public_benchmark_catalog

public_benchmark_catalog()

Return a tidy DataFrame summarizing all registered public open-data benchmarks.

Source code in src/scale_forecasting/benchmarks.py
def public_benchmark_catalog() -> pd.DataFrame:
    """Return a tidy DataFrame summarizing all registered public open-data benchmarks."""
    rows = [spec.to_dict() for spec in PUBLIC_BENCHMARK_SPECS.values()]
    return pd.DataFrame(rows)