seniorSupervised Learning
What is the difference between L1 and L2 regularization?
Updated May 17, 2026
Short answer
L1 regularization promotes sparsity, while L2 penalizes large weights smoothly.
Deep explanation
L1 adds absolute value penalty leading to feature selection by shrinking some weights to zero. L2 adds squared penalty reducing magnitude of all weights but rarely making them zero. L1 is useful for interpretability, L2 for stability.
Real-world example
L1 is used in gene selection in bioinformatics to identify important genes.
Common mistakes
- Assuming both regularizations behave the same way.
Follow-up questions
- What is elastic net?
- When should L1 be preferred?