difficulty 3/5
MSLE
MSE computed on the logarithms of the values — it measures the ratio between prediction and truth rather than the difference, so being wrong by a factor counts the same at any scale.
Intuition
Some targets span orders of magnitude. Predicting views on a video that might get 100 or 10,000,000 makes plain MSE almost useless: the handful of enormous values dominate the loss completely, and the model stops caring about everything else.
MSLE takes logarithms first. Because subtracting logarithms is dividing the original numbers, the error becomes a ratio rather than a difference. Being off by a factor of two costs the same whether the truth was 100 or 10,000,000.
Formal definition
How it works
Where it's used
Why & when
Worked example
Pitfalls
Check yourself
3 questions
The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.
On the cheat sheet: Regression metrics and losses →
Sources
- scikit-learn — sklearn.metrics.mean_squared_log_errordocs · retrieved 2026-08-30https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_log_error.html
- scikit-learn User Guide — Metrics and scoringdocs · retrieved 2026-10-04https://scikit-learn.org/stable/modules/model_evaluation.html
- Deep Learning (2016)bookhttps://www.deeplearningbook.org/
- Forecasting: Principles and Practice, 3rd ed.book · retrieved 2026-10-06https://otexts.com/fpp3/transformations.html