Regularized regression#

The question and the claim#

Regularization trades fit against a penalty to control effective complexity. Ridge shrinks coefficients, usually without setting them to zero; lasso can produce sparse coefficients; elastic net combines penalties. Selected features are not automatically mechanisms.

What you should be able to do#

  • Specify the scientific target and the observations needed to address it.

  • Verify disjoint row identifiers, compare coefficient stability, and interpret shrinkage separately from feature selection.

  • Explain the assumptions, uncertainty, and limits of your conclusion.

Worked investigation#

Tune ridge, lasso, and elastic net using identical inner folds and training-only scaling, refit the selected specification, and report its held-out error against a mean baseline. The worked notebook is self-contained and uses documented teaching data. Its output is evidence about that example, not a finding about a human population.

Challenge the result#

Negative R indices specify exclusions; they are not row identifiers that can safely be sampled as a test set. Hyperparameter selection must not depend on final test outcomes. Before running an analysis, predict what this failure would change. After running it, distinguish a software check from a scientific justification.

Practice and verification#

Complete the exercise, then discuss the interpretation questions. Submit a runnable notebook, your assumptions, and a short evidence-based interpretation. The shared analysis workflow defines the reporting and assessment standard.

For AI assistance, first write your own target and expected behavior. Use generated suggestions as candidates, inspect the code or claims, and retain evidence of the checks you performed. The AI analysis guide includes a saved-output activity that requires no account or paid service.

Connection across lessons#

Use the preceding model-selection framework and compare penalization with dimension reduction next.

Earlier lecture resources#

The recordings and slides below are retained from the earlier course edition and have not been revised. Use the written chapter, revised notebook, and exercise for current definitions and procedures; earlier examples may conflict with the corrections described here.

Required readings#

Chapter 6: Linear model selection and regularization. James, G., Witten, D., Hastie, T., & Tibshirani, R. (2021). An Introduction to Statistical Learning: with Applications in R (2nd edition). New York: Springer

Lecture (Video)#

Regularized regression

Slides (PDF)#

Regularized regression