Day 214 — Sample weights, and the three things they can encode
Monday, 8 March 2027 · Week 31 of 52 · Machine learning · Study day · 60 min
Uniqueness, return magnitude and recency are three separate reasons to weight an observation, they interact, and applying all three without thinking is how a model ends up fitted to the last six months of large moves.
What you should be able to do tonight
- Implement sample weights combining uniqueness, absolute return attribution and time decay, each switchable.
- Report the effect of each weighting component separately on out-of-sample performance.
Tasks 60 min
30 min Implement the three weight components in qlib/ml/labels.py, each separately toggleable: uniqueness, the absolute return attributable to the observation over its label window, and an exponential time decay with a stated halflife. Multiply them and normalise.
30 min Run the ablation rather than turning them all on: eight configurations across the three switches, evaluated under walk-forward with the effective sample size in the standard errors. Report which components help and by how much, and note that at least one probably does not. Log all eight.
Resources
Deliverable
A three-component sample weighting scheme with an eight-configuration ablation and all runs logged.
Checkpoint
You weight by uniqueness, by return size and by recency. Which one would you drop first, and what did the ablation say?
Prepare for tomorrow
Ten minutes tonight so Day 215, Tuesday, 9 March 2027 starts clean. This is what the evening email sends you.
Take one of your existing signals as a primary model and record when it says to trade.
Then ask a separate question: given that it says to trade, how often is it right?
Those are two different models, and tomorrow builds the second one.