Define overfitting in machine learning and explain why it is harmful.
Then describe L1 and L2 regularization:
-
How each one modifies the loss function.
-
The qualitative effect of each (e.g., sparsity, weight shrinkage).
-
How they help mitigate overfitting and when you might prefer one over the other.