Skip to main content

Regularization

Regularization is the "Police Force" of ML. It stops the model from cheating!

The Penalty​

It forces the model to find simple, smooth rules instead of jagged memorization lines (overfitting).

  • L1 (Lasso): Forces useless weights to zero (deletes useless features).
  • L2 (Ridge): Shrinks all weights to be very small.

Python Implementation​

Regularization Penalty Curves (L1 Lasso vs L2 Ridge)