Regularization – What is L1 and L2 regularization?
- Regularization eliminate or reduce the cofficeent of feature to zero if not needed. At a high level, L1 and L2 regularization are ways to “penalize” model complexity so your model doesn’t overfit the data.
🔹 Without regularization
- A model tries to fit the training data as closely as possible → can lead to:
- Overfitting
- Huge, unstable coefficients
🔹 With regularization
- We add a penalty for large coefficients, forcing the model to stay simpler.
L1 Regularization (Lasso)
- If a feature isn’t useful, eliminate it completely.
L2 Regularization (Ridge)
- “All features matter, but let’s tone them down.”