ML Case Labs — Validation, Boosting, Segmentation, Pipelines
Back to M1 — Regularized Regression + Validation Discipline

Regularized-Regression Case (Housing/Price)

Fit ridge/lasso, explain shrinkage effect. Housing train/holdout; leakage trap inside.

3 minutesReading
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.

Target: fit ridge/lasso on housing prices and explain the shrinkage effect in one paragraph a stakeholder can follow.

1. Baseline first

Fit plain OLS on the train split and record holdout RMSE. This number is the anchor: regularization must beat it or you keep OLS. No anchor, no claim.

2. Ridge vs lasso, decided by the goal

Ridge (L2) shrinks all coefficients smoothly — keeps every feature, tames collinearity. Lasso (L1) drives weak coefficients to exactly zero — automatic selection, at the cost of arbitrarily dropping one of two correlated features. Choose by reading the coefficient paths across alphas, not by fashion.

3. Trap: the leakage column

The starter includes a column derived from the sale paperwork (a post-outcome proxy). Train RMSE looks miraculous; holdout collapses. Diagnose by feature-ablation: drop each column, re-score, and name the one whose removal destroys the miracle.

Recap

OLS anchor, ridge for shrinkage / lasso for selection via alpha paths, and a leakage ablation that names the proxy column before you trust any RMSE.

Loading progress...