🔧 What is Regularization?

Regularization is a way to prevent overfitting in machine learning models.

Imagine trying to draw a smooth curve through points. Without regularization, you might end up drawing a super wiggly line that fits every point exactly. With regularization, you're encouraged to draw a simpler, smoother line.


🧮 Types of Regularization: L1 and L2

1. L1 Regularization (Lasso)

✅ Use L1 When:

📦 Example:

Imagine a dataset with 100 features, but only 10 really matter. L1 can shrink the other 90 coefficients to 0, simplifying the model.


2. L2 Regularization (Ridge)