Interact with the line and data points to see how MAE, MSE, RMSE, and $R^2$ quantify model performance in real-time.
Regression metrics summarize how far numeric predictions are from observed values, but they weight errors differently. For residual eᵢ = yᵢ − ŷᵢ, MAE averages absolute errors while MSE squares them, so large misses count more.
For n observations, let eᵢ = yᵢ − ŷᵢ.
|eᵢ|. It is in the target’s units and treats each unit of error linearly.eᵢ². It penalizes large errors more strongly and has squared target units.R² = 1 − SSE/SST, where SSE is squared prediction error and SST is variation around the target mean. It compares the model with predicting the mean; on test data it can be negative if the model performs worse than that baseline.Suppose three predictions have absolute errors 1, 1, and 4 units. MAE is (1 + 1 + 4)/3 = 2. MSE is (1² + 1² + 4²)/3 = 6, so RMSE is about 2.45. The 4-unit miss contributes 16 to the squared-error total, which explains why MSE and RMSE react more to large errors than MAE.
Use MAE when errors should count linearly and the result should be easy to explain. Use RMSE when large misses deserve extra weight. MSE is common as an optimization loss but its squared units are less intuitive. R-squared describes improvement over the mean baseline, not the typical error size; report it alongside MAE or RMSE when useful.
Mean absolute percentage error (MAPE) divides absolute error by the actual value. It can be useful when relative error is meaningful, but it is undefined at zero and unstable near zero. It can also weight over- and under-prediction asymmetrically. Do not use it blindly for demand or other targets that can be zero.
About to run: set Data Points to its maximum (100). Before it does — what happens to the readout?
Committing to an answer first is the point — the reveal runs the experiment on the visualisation above and reads the real value back, so nothing here is scripted.
Say the answer out loud before you reveal it — recalling it is what makes it stick, and rereading it is not.
What does this module say about “Start with residuals”?
What does this module say about “Worked example: one large miss”?
What does this module say about “A nearby metric: percentage error”?
Compare MAE, MSE, RMSE and R-squared on identical predictions and see which kinds of error each metric punishes hardest.