Ithy

Regression metrics calculator: MAE, MSE, RMSE and R²

Evaluate paired actual and predicted numbers without uploading a data file. This calculator uses unweighted single-output definitions, displays the error for every row, and keeps an undefined constant-target R² visible instead of forcing it to a convenient score.

Free to use, with no sign-in. Inputs and results stay in this page and are not sent with the form. Download a result before leaving; this tool does not save your work.

Enter your values

Worked result

MAE 0.5; MSE 0.375; RMSE approximately 0.612372435696; R² approximately 0.948608137045.

  1. Subtract each actual value from its prediction.
  2. Average absolute errors for MAE and squared errors for MSE.
  3. Take the square root of MSE; compare squared error with the target mean baseline for R².

Evaluate four actual–prediction pairs

Use actual values 3, -0.5, 2 and 7 with predictions 2.5, 0, 2 and 8. This is a small arithmetic example, not a trained-model benchmark.

Prediction errors = -0.5, 0.5, 0, 1
Absolute error total = 2
Squared error total = 1.5
MAE = 2/4 = 0.5
MSE = 1.5/4 = 0.375
RMSE = √0.375 ≈ 0.612372435696
Target mean = 2.875; SST = 29.1875
R² = 1 − 1.5/29.1875 ≈ 0.948608137045

MAE and RMSE use the target’s original units. MSE uses squared units. A high score on these four illustrative rows says nothing about generalization to new data.

Prediction errors and a mean-baseline comparison

MAE weights each absolute error linearly, while squaring in MSE increases the influence of larger errors. RMSE returns squared-error loss to the original target units. Compare metrics on the same target scale and evaluation data.

R² compares squared prediction error with the error from predicting the actual-target mean. It may be negative. If the actual targets are all constant, the denominator is zero and the ordinary R² formula is undefined; this tool does not apply a library-specific finite-score replacement.

eᵢ = predictedᵢ − actualᵢ
MAE = Σ|eᵢ|/n
MSE = Σeᵢ²/n; RMSE = √MSE
R² = 1 − Σeᵢ²/Σ(actualᵢ − mean(actual))²

Input limits and common mistakes

Provide at least one pair for error metrics and at least two nonconstant actual values for R². Each row must have exactly two finite numbers. Weights, multi-output aggregation and missing values are not supported.

These are evaluation losses divided by n, not the residual mean-square estimator divided by n minus fitted parameters. Use an appropriate held-out or cross-validation design before interpreting predictive performance. No causal or model-quality verdict is generated.

Questions about mae, mse, rmse and r²

Can R² be negative?

Yes. It is negative when squared prediction error exceeds the squared error of predicting the evaluation target mean.

Why is R² undefined for constant targets?

All actual values equal their mean, so the denominator in the ordinary formula is zero. This tool reports that condition explicitly.

Is MSE the same as residual variance?

Not generally. This prediction metric divides by the observation count; a residual-variance estimate may use degrees of freedom based on fitted parameters.

Sources and verification

These references explain the formulas or formats. The worked examples above were created for this tool and checked against independent calculations or format round trips. AI-assisted development does not imply a named human expert review.

Published 2026-10-23. Examples are illustrations, not measurements of a service or claims about search rankings.

Related tools

Standard deviation

Calculate sample and population variance and standard deviation together. See the mean, squared-deviation sum and the n versus n−1 denominator.

Mean, median and mode

Find mean, median, all repeated modes, range, sum and a sorted list. See how an outlier changes the average compared with the middle value.

Percentage change

Calculate relative percentage change, absolute change, multiplier and the reverse change. Distinguish percentage points from relative percent.

Further reading

All calculators and developer tools · Source-checked guides · How Ithy checks sources