aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 9. Overfitting and Regularization
Lesson 4 of 6 8 min · 126 words

L2 regularization

Shrinking weights smoothly; always gives a unique solution.

L2 regularisation (ridge, weight decay) adds to the loss. Large weights are expensive, so the model spreads influence across features and becomes smoother and less sensitive to small input changes.

For linear regression it has the closed form . The added makes the matrix always invertible, so there is always a unique solution — even with correlated features or more features than examples.

In gradient descent, the penalty adds to the gradient, so each step first shrinks the weights by a constant factor — hence the name weight decay.

Formula to remember

Ridge closed form

λI keeps the matrix invertible.

Quick check · +5 XP

Learning curves that quickly meet at a high error suggest…

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser