Which penalty, or none?
Seven linear models side by side, the pairs people confuse, and one run in which the best predictor is not the best selector of features.
prints on 2 A4 pagesfrom 8 pages and 1 cataloguefree to read · PDF with a free accountUpdated 23 Oct 2026
The PDF and the Print button ask you to sign in; a free account is enough. Reading and Test yourself are open to everyone.
Side by side
The first columns are the Linear model family catalogue’s; the rest come from each page.
A formula is printed only when it is shorter than the words; the others are said in words, and each page has its formula.
Easy to confuse
The “what is the difference between…” questions, in two lines each.
Ridge regression vs Lasso regression
Ridge shrinks every coefficient and keeps them all; lasso sets some exactly to zero.
Ridge when most features matter; lasso when most do not and the model must prove which.
Lasso regression vs Elastic Net
Of a group of correlated features lasso tends to keep one, almost at random; elastic net tends to keep the group.
Elastic net when features come in correlated groups, or when you do not know which penalty fits.
Linear regression vs Logistic regression
Both score a weighted sum of the features; logistic regression turns it into a probability.
Logistic for a yes-or-no outcome, read as log-odds; linear for a number.
α vs C
Ridge and lasso's α is the penalty's strength; logistic regression's C is its inverse.
Larger α means more penalty; larger C means less. Search both on a log scale.
One real run
Fifty features, five with signal and each with a near-twin; each penalty tuned by cross-validation.
| Model | Test MSE | Nonzero | True kept | Twins | Stable |
|---|---|---|---|---|---|
| ols | 6.95 | 50 | 5 | 5 | 1.00 |
| ridge | 6.14 | 50 | 5 | 5 | 1.00 |
| lasso | 4.46 | 20 | 4 | 2 | 0.45 |
| elastic-net | 5.10 | 35 | 5 | 5 | 0.63 |
“Lasso predicts best and still chooses badly.”
“Elastic net keeps the pairs together.”
“Ridge shrinks and keeps everything.”
The run and these lines are the worked example on Regularization, as it printed: 50 features, 5 with signal, each with a near-twin; 100 training rows
Which one?
Is the outcome a class?
- Yes, yes or no Logistic regression
Do most features matter?
- Yes, most carry some signal Ridge regression
- No, most are noise Lasso regression
- Unsure, and they come in groups Elastic Net
Is the relation curved?
- Smoothly, at low order Polynomial regression
Do you need uncertainty on each prediction?
- Yes, or there is little data Bayesian linear regression
Each answer is from its page’s “Why & when”.
All 31 traps on these pages
Each is the opening line of a pitfall; its page says why.
Linear regression
- A coefficient is not a cause.
- A high score is not a good fit.
- Extrapolation is unsupported.
Ridge regression
- Standardise first.
- Ridge never gives you a sparse model.
- α does not transfer between datasets.
- Do not read ridge coefficients as effect sizes.
Lasso regression
- Standardise first — and here it changes which features are selected.
- Correlated features make selection unstable.
- Selection is not significance.
- α is not comparable to ridge's α.
Elastic Net
- Two hyperparameters means a 2-D search.
- l1_ratio near 0 is ridge with extra steps.
- Standardise first.
- The grouping effect is a tendency, not a guarantee.
Bayesian linear regression
- A wide interval is information, not a defect.
- "Bayesian" here does not mean fully Bayesian.
- The intervals are only as good as the assumptions.
- Scale your features.
Polynomial regression
- Powers explode in magnitude.
- Extrapolation is catastrophic, not merely unreliable.
- Degree is a capacity dial and needs held-out selection.
- Watch the feature count.
Logistic regression
- C runs backwards from alpha.
- Coefficients are log-odds, not probabilities.
- Scale your features.
- Perfect separation breaks the unregularized model.
Regularization
- Unscaled features make the penalty arbitrary.
- Do not penalise the intercept.
- α must be chosen on held-out data.
- Regularized coefficients are biased on purpose.