Machine Learning & AI
Intermediate

L2 Regularization (Ridge)

Adds a penalty on squared weights to reduce overfitting.

Formula

J=MSE+λjwj2J = \text{MSE} + \lambda\sum_j w_j^2

Variables

\lambdaRegularization strength
w_jWeights

Example

Large lambda shrinks all weights toward zero

Did You Know?

L2 shrinks weights smoothly toward zero but rarely makes them exactly zero.

Share this formula