Suppose you want to predict a house price from ten measurements — size, age, distance to a school, and seven more. Linear regression fits a weight to each measurement so the predicted prices match the training set as closely as possible. The trouble is, "as closely as possible" can mean the model chases every bump and wiggle in the data — overfitting — and then fails badly on new houses.
The root cause is that the algorithm is free to make any weight as large as it likes. A huge positive weight on one feature can cancel a huge negative weight on another, producing a perfectly fitted training curve that is pure noise.
The solution is surprisingly clean: add a penalty to the objective. Instead of minimising only the prediction error, also penalise large weights. The model still wants to fit the data, but now every large weight comes at a cost.
- Ridge (also called L2 regularisation), introduced in its modern form by Hoerl and Kennard in 1970, adds the sum of squared weights to the loss. All weights shrink toward zero, but none ever reach it exactly.
- Lasso (Least Absolute Shrinkage and Selection Operator), formalised by Tibshirani in 1996, adds the sum of absolute weights instead. The key difference: Lasso's geometry forces some weights all the way to exactly zero, effectively deleting those features from the model.
The result is a solved and practical technique — Ridge and Lasso are not open problems but mature, well-understood tools that sit at the core of modern machine learning. The interesting question is not if they work, but how the choice of penalty shape changes the solution.
Comments
Loading comments...