Ridge Regression (L2 Regularization)
Ridge regression adds a penalty term (L2 regularization) to the linear regression cost function. It helps prevent overfitting by forcing the coefficients to be small.
👉 What it does: Adds a penalty to shrink coefficients (but never makes them zero)
✅ When to use:
- You have many features
- Features are highly correlated
- You want to reduce overfitting, but keep all variables
🧠 Real-life examples:
- Predicting stock prices using dozens of financial indicators
- Modeling customer behavior with many overlapping variables (age, income, spending habits)
- Healthcare: predicting outcomes using many correlated biomarkers
💡 Key idea: 👉 Keeps all features, just reduces their impact