Selecting a model for a purpose#

The question and the claim#

Best is conditional on an objective, candidate set, and evaluation design. Predictive accuracy, explanatory adequacy, parsimony, and causal identification are distinct. Searching many models adds uncertainty that a single winning score conceals.

What you should be able to do#

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

  • Prespecify candidates and the decision rule. Keep every simulated outcome, including an intercept-only or full-model winner.

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

Worked investigation#

Choose among nested feature sets with inner cross-validation, evaluate once on held-out data, and examine selection instability across repeated training samples. 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#

Changing the random seed until an expected optimum appears selects favorable evidence. Reusing the test set for model search invalidates its role as a final assessment. 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#

Combine honest validation and simulation; regularization offers a structured alternative to discrete subset search.

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)#

Selecting the 'best' model

Slides (PDF)#

Selecting the 'best' model