Lab · c14.s03.L1
Ridge shrinkage
One penalty dial slides the fitted weights toward zero, trading a slightly worse fit on the sixteen afternoons for better predictions on afternoons the model has not seen.
Question: Why does adding a penalty on the size of the coefficients make predictions on new data better, even though it fits the data you already have worse?
Frame 1 of 10: No penalty (step 0)At λ = 0 the pair of near-duplicate sun records gets opposite weights, 3.2497 and -2.3076, whose contributions nearly cancel: the training miss is 0.09835, the smallest on the path, while the new-afternoon miss is 0.3563.
No penalty (step 0). At λ = 0 the pair of near-duplicate sun records gets opposite weights, 3.2497 and -2.3076, whose contributions nearly cancel: the training miss is 0.09835, the smallest on the path, while the new-afternoon miss is 0.3563.
Keyboard: Space plays or pauses, Left and Right step, Home goes to the first frame, End goes to the last frame.
Text description of this lab
Two panels share one penalty dial. Left is the plane of the two fitted sun-record weights: at no penalty the point sits at 3.2497 and -2.3076, and as the penalty grows it slides along a curve into the origin. Right, average squared miss against penalty on a logarithmic error axis: the dotted training curve rises slowly, while the new-afternoon curve falls from 0.3563, bottoms out at 0.16354 at step 28, then climbs to 3.18486, so the middle setting predicts best.
Return to the section that hosts this lab
Caption status: synthetic. Every lab declares one of published, re-simulated, schematic, synthetic or interpolated.