What is regularization in cost functions?

Updated May 15, 2026

Short answer

Regularization adds penalty terms to cost to reduce overfitting.

Deep explanation

L1 and L2 regularization discourage overly complex models by penalizing large weights.

Real-world example

Used in credit scoring models to avoid overfitting customer data.

Common mistakes

  • Setting lambda too high causing underfitting.

Follow-up questions

  • Difference between L1 and L2?
  • Does regularization always improve accuracy?

More Cost Function interview questions

View all →