Experiment¶
Experiments run flows under controlled conditions and summarize their results in
a Scorecard. The artifact cache reuses expensive intermediate results, and the
statistics helpers quantify uncertainty in performance metrics.
Experiment¶
signalflow.Experiment ¶
Lifecycle wrapper: run a Flow, store the Run, score it against a baseline.
Source code in src/signalflow/experiment/experiment.py
run ¶
Backtest flow on data, store the Run, and stamp first_result.
Source code in src/signalflow/experiment/experiment.py
stamp ¶
Record stage with timestamp ts (or the clock's value).
Source code in src/signalflow/experiment/experiment.py
signalflow.Scorecard ¶
Namespace for scorecard construction; the product is a plain dict.
from_run
staticmethod
¶
Summarize run into a stable-shape dict, optionally vs baseline.
Source code in src/signalflow/experiment/scorecard.py
Artifact cache¶
signalflow.ArtifactCache ¶
Disk cache of polars frames addressed by a content + code-fingerprint key.
Source code in src/signalflow/experiment/cache.py
compute_cached ¶
Return the cached frame for key or compute it via fn and store it.
Source code in src/signalflow/experiment/cache.py
key ¶
Compute the content-addressed key for parts.
Source code in src/signalflow/experiment/cache.py
Statistics¶
signalflow.bootstrap_ci ¶
Percentile bootstrap CI for the mean return.
Source code in src/signalflow/experiment/stats.py
signalflow.monte_carlo_bounds ¶
Resample per-period returns into n synthetic equity paths and report
the terminal-equity distribution.
Each path is a sequence of horizon returns drawn with replacement from
the observed returns (horizon defaults to the number of observed
returns); terminal equity is the cumulative product starting from 1.0.
Returns 5th/50th/95th percentiles plus mean/min/max. Deterministic for a
fixed seed.