Day 205 — Overlapping labels break the assumption everything rests on

Saturday, 27 February 2027 · Week 30 of 52 · Machine learning · Study day · 60 min

You already refuse to split relatives across folds of a genetic prediction study; overlapping forward returns are the same dependence structure, and standard cross-validation walks straight into it.

What you should be able to do tonight

  • State precisely which assumption overlapping labels violate and what it does to a cross-validated performance estimate.
  • Demonstrate the inflation with a synthetic experiment where the true relationship is zero.

Tasks 60 min

35 min Build the demonstration: generate features with no relationship at all to forward returns, construct 10-day overlapping labels, and run standard 5-fold cross-validation. The cross-validated R-squared will be positive and it will look significant. Report it, then repeat with non-overlapping labels and show it collapses.

25 min Write the mechanism out: adjacent observations share most of their label, so a fold boundary places nearly identical observations on both sides, and the model is scored partly on data it trained on. Name the analogous situation in your own field and note that the correction there is the same one you will build tomorrow.

Resources

Deliverable

notebooks/day-205-overlap.ipynb showing a positive cross-validated R-squared on pure noise with overlapping labels, and its collapse without them.

Checkpoint

Standard k-fold is wrong on financial data. Give two separate reasons and say which one overlapping labels cause.

Prepare for tomorrow

Ten minutes tonight so Day 206, Sunday, 28 February 2027 starts clean. This is what the evening email sends you.

Draw the timeline of a single test fold and mark which training observations touch it, on either side.

The set you would need to remove has two parts and they are removed for different reasons.

Name both before tomorrow tells you.