Why must the regularization parameter lambda be selected on validation data rather than training data?
Last updated
Training error almost always falls as λ falls, because a less constrained model can fit the training data better. Selecting on training data would therefore always pick λ ≈ 0, which is no regularization at all. λ exists to optimize generalization, so it must be chosen using data the fit did not see.
Training error is a biased estimate:
It is optimistic, and the optimism grows with model flexibility (effective degrees of freedom).
Lowering
λraises flexibility, so training error rewards overfitting.
Validation error estimates generalization:
It traces the U-shaped bias–variance curve. Large
λunderfits, smallλoverfits, and the minimum sits in between.K-fold cross-validation reduces the noise of a single split.
Keep the test set separate:
Tuning
λon validation data makes validation error optimistic too, because you picked the minimum.Report performance on an untouched test set, or use nested CV.
Avoid leakage:
Fit preprocessing such as scaling or feature selection inside each training fold.
Scaling matters especially here, because penalties depend on feature scale.
Alternatives: information criteria (AIC, BIC) or generalized CV. These adjust training error for complexity analytically, but they still don't simply minimize raw training error.