Day 207 — Walk-forward, and what it costs you in statistical power
Monday, 1 March 2027 · Week 30 of 52 · Machine learning · Study day · 60 min
Cross-validation with purging still uses future data to train models scored on the past, which is defensible for estimating a relationship and not for estimating what you would have earned.
What you should be able to do tonight
- State the difference between what purged cross-validation and walk-forward each estimate.
- Report the same model under both schemes and explain the gap.
Tasks 60 min
35 min Implement walk-forward in qlib/ml/cv.py: expanding and rolling window variants that only ever train on the past. Then run one model under purged cross-validation and under both walk-forward schemes and report the three out-of-sample R-squared values with intervals.
25 min Say what each number means: purged cross-validation estimates whether a relationship exists in this dataset, walk-forward estimates what a person following this procedure would have earned. They answer different questions and the second is smaller, noisier and the one that goes in the milestone.
Resources
Deliverable
Walk-forward splitters in qlib/ml/cv.py, and one model’s out-of-sample R-squared under three schemes with intervals.
Checkpoint
Purged cross-validation and walk-forward give different numbers for the same model. Which do you report and why?
Prepare for tomorrow
Ten minutes tonight so Day 208, Tuesday, 2 March 2027 starts clean. This is what the evening email sends you.
Split your sample into four eras and fit the same simple model separately in each.
Compare the coefficients across the four.
Note the one that changes sign, if any.