Day 213 — Sample uniqueness, and the effective size of your training set

Sunday, 7 March 2027 · Week 31 of 52 · Machine learning · Study day · 65 min

The overlap counts you plotted last night mean your hundred thousand training rows contain far fewer independent observations, and every standard error in the phase depends on knowing how many.

What you should be able to do tonight

  • Compute average uniqueness per observation and derive the effective sample size of your training set.
  • Say what an inflated effective sample size does to a model comparison, and in which direction.

Tasks 65 min

30 min Implement uniqueness in qlib/ml/labels.py: for each observation, the average over its label window of the reciprocal of the number of concurrent labels. Then report the effective sample size as the sum of uniqueness across the training set, against the raw row count. The ratio is often four or five to one.

25 min Show what it changes: recompute the standard error of your out-of-sample R-squared using the effective sample size rather than the row count, and note how many model comparisons that reclassifies from significant to indistinguishable. This is the same correction as clustering standard errors, applied to a machine learning workflow that usually does not do it at all.

10 min Note the second use: bagging with a sample size set by uniqueness rather than by the row count, which is where tomorrow starts.

Resources

Deliverable

Uniqueness and effective sample size computed for your dataset, with the corrected standard error on out-of-sample R-squared.

Checkpoint

Overlapping labels break an assumption most estimators rely on. Which one, and what is the standard correction?

Prepare for tomorrow

Ten minutes tonight so Day 214, Monday, 8 March 2027 starts clean. This is what the evening email sends you.

Write down two reasons you might want to weight one training observation more than another, other than uniqueness.

One is about how much the observation moved, and one is about how old it is.

Two sentences.