R-squared, MAE, RMSE, and MAPE
Explore fundamental regression evaluation metrics such as R-squared, mean absolute error (MAE), root mean squared error (RMSE), and mean absolute percentage error (MAPE). Understand how each metric treats prediction errors differently and when to apply them based on business costs and data characteristics. Learn to interpret these scores to choose the right metric for your forecasting needs and ensure reliable model evaluation.
A demand forecast of 1000 units can fail in two costly directions. Forecasting 700 units may cause stockouts and lost sales. Forecasting 1300 units may create excess inventory and storage costs. A forecast score must reflect which failures matter most.
A metric is a rule that converts many prediction errors into one score. The same predictions can receive different scores because each metric treats errors differently. A grocery buyer facing expensive stockouts may prioritize large misses, while a finance team may need an error number that reads directly as units or dollars. Metrics summarize errors, but residual diagnostics still check whether those errors follow a harmful pattern.
MAE and RMSE measure error in target units
For the same actual demand and forecasts, mean absolute error (MAE) and root mean squared error (RMSE) answer different questions. Mean absolute error (MAE) averages the size of each error after removing its sign. A forecast that is 20 units too high counts the same as one that is 20 units too low.
Root mean squared error (RMSE) squares each error before averaging, then takes the square root. Squaring gives a large miss much more weight than a small miss.
The following demand values include several close forecasts and one large miss. The printed row-level errors make clear which forecast drives the difference between the two scores.
Lines 6–7: The arrays ...