R-Squared Calculator

R² (R-squared) measures how much of the variation in the actual values your model explains: 1 minus the ratio of residual error to total variance. 1.0 is a perfect fit, 0 means the model is no better than predicting the mean, and negative values mean it is worse. Paste one "actual, predicted" pair per line.

One pair per line: actual value, then predicted value — e.g. "3, 2.5".

Result

Enter your values and press Calculate — the result appears here.

Worked examples

A strong linear fit

  • pairs = 3, 2.5 -0.5, 0 2, 2 7, 8

Result: R² 0.9486 — 94.9% of variance explained

Perfect fit

  • pairs = 1, 1 2, 2 3, 3

Result: R² 1.00

Worse than the mean

  • pairs = 1, 5 2, 6 3, 7

Result: R² negative — predictions worse than just using the average

Frequently asked questions

What does R² mean in plain words?

The proportion of the variation in the actual values that the model accounts for. R² = 0.95 means the model explains 95% of the variance; the remaining 5% is unexplained error.

Can R² be negative?

Yes. R² is negative when the model is worse than simply predicting the mean of the actuals for every point — the residual error exceeds the total variance. It is not bounded below by 0.

Why is R² undefined with constant actuals?

R² divides by the total variance of the actual values (SS_tot). If every actual is identical, SS_tot is zero and R² is 0 ÷ 0 — undefined. With such data, no model can explain variance that does not exist.

💬 Discuss on BestWordz Community

Join the conversation about Machine Learning, r squared, coefficient of determination on the BestWordz Community forum.

Visit Forum →
Copied!