Regularization

Prevent overfitting by penalizing large coefficients.

L2 Regularization (Ridge)

  • Shrinks coefficients toward zero
  • Doesn’t set coefficients exactly to zero
  • Good when all features are relevant

L1 Regularization (Lasso)

  • Can set coefficients exactly to zero
  • Performs feature selection
  • Good for high-dimensional sparse data

Elastic Net

Combines L1 and L2: