WRITE · TRACE · UNDERSTAND
Project: walk-forward forecasts with delayed labels and a purge gap
Rows have unique id and finite t, available, x,y; available>=t.
Read lesson: Project: walk-forward forecasts with delayed labels and a purge gap →
Your experiment
Rows have unique id and finite t, available, x,y; available>=t. Cutoffs are finite, unique and strictly increasing; horizon>0 and gap>=0 are finite. At each cutoff, fit only rows with t<=cutoff-gap and label available<=cutoff. Forecast rows cutoff<t<=cutoff+horizon. Fit the centered one-feature ridge formula with penalty .1. Return one window with cutoff,status; evaluated windows also contain train_ids,held_ids,predictions,mse. Return status insufficient if fewer than two fitting rows or no held rows. Evaluation uses offline future truth; it must not enter fitting.
Python runs in your browser. Your draft stays on this device.
What to look for
Review both clocks, the gap convention, overlapping windows and insufficient history. A production backtest also needs historical feature availability and immutable data snapshots. Replay follows the main orchestration function; helper computations execute and are checked separately.
Watch your code work
Ready to experimentWrite a solution or load the worked answer, then choose Trace & check.
Step through arrays, variables and training curves produced by your own Python.
