Glossary term
Glossary term
Foundations
A loss function that calculates the square of the difference between actual label values and the values that a model predicts. For example, here's the calculation of L2 loss for a batch of five examples:
Due to squaring, L2 loss amplifies the influence of outliers. That is, L2 loss reacts more strongly to bad predictions than L1 loss. For example, the L1 loss for the preceding batch would be 8 rather than 16. Notice that a single outlier accounts for 9 of the 16.
Regression models typically use L2 loss as the loss function.
The Mean Squared Error is the average L2 loss per example. Squared loss is another name for L2 loss.
Click the icon to see the formal math.
See Logistic regression: Loss and regularization in Machine Learning Crash Course for more information.
Created for this library
A retail forecasting team uses L2 loss for its weekly sales model because squared error penalizes large misses more strongly.
A pricing team uses L2 loss in its production demand model because the financial cost of large prediction errors scales super-linearly.
A research team uses L2 loss as the default for regression baselines because it produces smooth, well-understood gradients.
Definition source: Google for Developers Machine Learning Glossary | Creative Commons Attribution 4.0 License