induwara.lk
induwara.lkAI · Machine learning

Regression Metrics Calculator — MAE, MSE, RMSE, R² & MAPE

Paste a column of predicted values and a column of actual values to get every standard regression error metric at once — MAE, MSE, RMSE, R², Adjusted R² and MAPE — each with its formula and a full residual table. Free, no signup, runs entirely in your browser.

By Induwara AshinsanaUpdated Jun 9, 2026
Regression error metrics

The ground-truth values. Separate with commas, spaces, or new lines.

Your model's predictions, in the same order as the actual values.

Examples
MAE
0.875
Σ|ŷ−y| / n
Mean absolute error · lower is better
MSE
1.3125
Σ(ŷ−y)² / n
Mean squared error · lower is better
RMSE
1.1456
√MSE
Root mean squared error · units of y
0.6441
1 − SS_res / SS_tot
64.41% of variance explained
Adjusted R²
0.4661
1 − (1−R²)(n−1)/(n−p−1)
Penalised for p = 1 predictor
MAPE
32.7381%
100·Σ|(ŷ−y)/y| / m
Mean absolute % error · lower is better
R² = 0.6441

Moderate — the model explains about half of the variance.

MAPE = 32.7381%

Reasonable — average error between 20% and 50%.

Residuals (4 rows)

#ActualPredictedError
132.5-0.5
2550
324+2
478+1

Computed entirely in your browser — your data never leaves your device. Formulas per scikit-learn and the NIST e-Handbook; last verified 2026-06-09.

How it works

Regression metrics summarise how far a model's predictions ŷ fall from the true values y across n paired points. Every metric on this page is derived from the per-row error eᵢ = ŷᵢ − yᵢ, using the definitions published by scikit-learn and the NIST e-Handbook of Statistical Methods.

The error-magnitude metrics are:

  • MAE = (1/n)·Σ|ŷ−y|
  • MSE = (1/n)·Σ(ŷ−y)²
  • RMSE = √MSE
  • MAPE = (100/m)·Σ|(ŷ−y)/y| over rows where y ≠ 0

MAE is the average absolute error and treats every mistake equally. MSE squares the errors first, so a handful of large misses dominate it; RMSE takes the square root to bring the figure back into the units of your target, which is why RMSE is the most quoted single number. Because RMSE weights big errors more, RMSE is always at least as large as MAE, and the gap between them widens when error sizes vary.

The goodness-of-fit metric R² compares your model against the simplest baseline — always predicting the mean ȳ:

R² = 1 − SS_res / SS_tot, where SS_res = Σ(ŷ−y)² and SS_tot = Σ(y−ȳ)²

R² of 1 is a perfect fit, 0 means no better than predicting the mean, and a negative value means the model fits worse than that mean baseline. R² is not clamped here, matching scikit-learn. When every actual is identical, SS_tot is 0 and R² is genuinely undefined (0/0); the tool says so rather than printing a misleading number. Adjusted R², 1 − (1 − R²)·(n − 1)/(n − p − 1), corrects R² for the number of predictors p so adding useless features no longer inflates the score. MAPE reports error as a percentage of the actual value, which makes it scale-free and easy to explain — but it divides by y, so rows where the actual is 0 are excluded and the count is shown. Each metric is computed directly from the raw values, never from rounded intermediates, and MSE is cross-checked against its moment-expansion form so the result is trustworthy to the last decimal.

Worked examples

Example 1 — typical regression (y=[3,5,2,7], ŷ=[2.5,5,4,8])

  1. errors ŷ−y = [−0.5, 0, 2, 1]; |err| = [0.5, 0, 2, 1]; err² = [0.25, 0, 4, 1]
  2. MAE = 3.5 / 4 = 0.8750
  3. MSE = 5.25 / 4 = 1.3125 → RMSE = √1.3125 = 1.1456
  4. ȳ = 17/4 = 4.25; SS_tot = 1.5625+0.5625+5.0625+7.5625 = 14.75; SS_res = 5.25
  5. R² = 1 − 5.25/14.75 = 0.6441
  6. MAPE = 100·(0.5/3 + 0 + 2/2 + 1/7)/4 = 32.74%

Example 2 — perfect prediction, edge case (y=[10,20,30], ŷ=[10,20,30])

  1. Every error is 0 → MAE = 0, MSE = 0, RMSE = 0, MAPE = 0%
  2. SS_res = 0; ȳ = 20; SS_tot = 100+0+100 = 200
  3. R² = 1 − 0/200 = 1.0000 ← the upper bound is confirmed

Example 3 — mean-baseline predictor, edge case (y=[1,2,3,4], ŷ=[2.5,2.5,2.5,2.5])

  1. errors = [1.5, 0.5, −0.5, −1.5]; err² = [2.25, 0.25, 0.25, 2.25]
  2. MAE = 4 / 4 = 1.0000; MSE = 5 / 4 = 1.25; RMSE = √1.25 = 1.1180
  3. ȳ = 2.5; SS_tot = 5; SS_res = 5 → R² = 1 − 5/5 = 0.0000
  4. R² = 0 confirms: predicting the mean every time scores exactly zero.
  5. MAPE = 100·(1.5/1 + 0.5/2 + 0.5/3 + 1.5/4)/4 = 57.29%

Frequently asked questions

Sources & references

Every formula on this page was cross-checked against the scikit-learn and NIST definitions on 2026-06-09. The tool runs entirely in your browser — your predictions and actuals never leave your device.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, an edge case, or want CSV import added?

Email me at [email protected] — most fixes ship within 24 hours.