Day 222 — A hyperparameter search is a multiple testing problem
Tuesday, 16 March 2027 · Week 32 of 52 · Machine learning · Study day · 60 min
Everything you learned in week 8 applies to a grid search, and the standard workflow of picking the best cross-validated configuration is exactly the procedure your noise floor was built to correct.
What you should be able to do tonight
- Say what selecting the best of N hyperparameter configurations does to the cross-validated estimate, and quantify it for your own search.
- Implement nested validation so the selection and the evaluation use different data.
Tasks 60 min
30 min Measure the selection bias: run your grid on pure-noise labels and report the best cross-validated R-squared it finds. That number is the bias in your reported figure for a grid of that size, and it is subtracted rather than argued about.
30 min Implement nested validation in qlib/ml/: an inner purged split for hyperparameter selection and an outer walk-forward split for evaluation, so the number you report was never used for selection. Rerun both models and report the difference against the non-nested figures.
Resources
Deliverable
Nested validation implemented, with the noise-label selection bias measured and the nested and non-nested figures compared.
Checkpoint
You searched 400 hyperparameter configurations. How much of your best cross-validated R-squared is selection, and how did you measure it?
Prepare for tomorrow
Ten minutes tonight so Day 223, Wednesday, 17 March 2027 starts clean. This is what the evening email sends you.
Compute the built-in feature importances from your tree models and rank the features.
Compare that ranking against the regularization path ordering from day 219.
They will disagree. Note where.