Run An Experiment
Experiment is the public workspace for one forecasting question. It collects the few choices a researcher should specify, fills the rest from the default profile, then lowers to the internal recipe and execution engine.
import macroforecast as mf
exp = mf.Experiment(
dataset="fred_md",
target="INDPRO",
start="1980-01",
end="2019-12",
horizons=[1, 3, 6],
)
result = exp.run()
Required arguments:
dataset: FRED source panel, one offred_md,fred_qd,fred_sd,fred_md+fred_sd, orfred_qd+fred_sdtarget: target series namestart: first sample dateend: last sample date
Common optional arguments:
horizons: forecast horizons, default[1]frequency: required only forfred_sdalonecustom_source_policy: defaultofficial_only; usecustom_panel_onlyorofficial_plus_customfor custom filescustom_source_path: required when custom data is selected; parser/schema are inferred from the path extension and route frequencyvintage: data vintage; if omitted, current/latest data is usedmodel_family: default model, usually left asarprimary_metric: defaultmserandom_seed: default42
Layer 0 In Simple
Simple exposes only the Layer 0 Study Scope decision. The run shape picks it:
exp.run()with one target and one method path ->one_target_one_methodexp.compare_models([...]).run()with one target ->one_target_compare_methods
The remaining Layer 0 policies are defaulted:
Policy |
Simple default |
Effect |
|---|---|---|
|
|
Stop on the first failed cell or variant. |
|
|
Apply seed discipline; |
|
|
Execute sequentially. |
These resolved defaults are still written to the lowered recipe and manifest. To select non-default failure handling, reproducibility mode, or compute layout directly, use the Full YAML path in Detail (code).
Inspect the lowered recipe before running:
recipe = exp.to_recipe_dict()
Run with a custom output root:
result = exp.run(output_root="outputs/indpro_default")
The simple API is a facade. It does not bypass recipes, manifests, or provenance. Every default it fills is written to the manifest.
Single Run Or Sweep
If no sweep axes are present, run() returns ForecastResult.
result = exp.run()
result.forecasts
result.metrics
result.manifest
If .compare_models() or .sweep() creates multiple variants, run() returns ForecastResult.
sweep = exp.compare_models(["ridge", "lasso"]).run()
sweep.variants
sweep.compare("mse")