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:
- Observed historical + future covariate panel (
dataset.df) — the exact DataFrame handed toForecaster.build_config()orForecaster.auto(), including future covariate rows over the forecast horizon when exogenous drivers exist. - 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:BenchmarkSpecdeclaring 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
¶
A generated DGP benchmark panel paired with its ground-truth spec and oracle expectations.
Attributes:
| Name | Type | Description |
|---|---|---|
spec |
BenchmarkSpec
|
The :class: |
df |
DataFrame
|
Historical panel ( |
future_df |
DataFrame
|
Future covariate rows over the forecast horizon ( |
oracle_future_df |
DataFrame
|
Exact noise-free conditional expectation ( |
full_panel_with_future_covariates
property
¶
Return historical rows concatenated with future covariate rows (y = NaN in future).
summary_dict
¶
Return a JSON-friendly summary of the benchmark spec and generated row counts.
Source code in src/scale_forecasting/benchmarks.py
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
¶
Serialize to a JSON-friendly dictionary.
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
¶
Serialize to a JSON-friendly dictionary.
benchmark_catalog
¶
Return a summary DataFrame describing all 12 canonical DGP benchmark panels.
Source code in src/scale_forecasting/benchmarks.py
fetch_public_benchmark
¶
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 | |
list_benchmarks
¶
list_public_benchmarks
¶
load_benchmark
¶
Deterministically generate one canonical DGP benchmark dataset by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Benchmark identifier in :data: |
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: |
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 | |
public_benchmark_catalog
¶
Return a tidy DataFrame summarizing all registered public open-data benchmarks.