# R-Squared

> A score for models that guess numbers. 1 is perfect, and 0 is no better than the average.

**Field:** Artificial Intelligence  
**Category:** Evaluation & Benchmarks  
**Also known as:** R², Coefficient of Determination, R2 Score

## Think of it like

It is like a grade for how well a line follows the dots. A full mark means it hits every dot.

## Definition

R-squared tells you how much of the ups and downs in a number a model explains. It compares the model's errors with a plain guess that always says the average. A score of 1 means the model gets every value right. A score of 0 means it does no better than the average. On new data, it can even drop below 0, which means it does worse than the average. It is often written R² and read as a share, so 0.8 is 80%.

## Formula

```
R² = 1 - (sum of squared errors ÷ sum of squared gaps from the mean)
```

## Example

Lucy's model guesses flat prices from size and street. It gets an R-squared of 0.75, so it explains about three quarters of why the prices differ.

## Why it matters

It has no units, so you can compare models on one task at a glance. It also shows if a model beats the simplest guess.

## Common mistake

Trusting a high R-squared from the training data. Check it on a test set, or an overfit model will look great.

## Three principles

- **Beat the average.** 0 means no better than the mean.
- **1 is perfect.** Every value matched.
- **No units.** Easy to compare on one task.

## Related terms

- [Mean Absolute Error (MAE)](https://learn.benibix.com/term/ai/mean-absolute-error)
- [Root Mean Squared Error (RMSE)](https://learn.benibix.com/term/ai/root-mean-squared-error)
- [Regression Analysis](https://learn.benibix.com/term/general/regression-analysis)
- [Mean (Average)](https://learn.benibix.com/term/general/mean)
- [Linear Regression](https://learn.benibix.com/term/ai/linear-regression)
- [Overfitting](https://learn.benibix.com/term/ai/overfitting)

![Five dots sit near a straight line, each joined to it by a short gap. One dot sits far away. Three boxes show the scores: MAE, RMSE and R-squared.](https://learn.benibix.com/diagrams/ai5-regression-errors.svg)

---

Source: https://learn.benibix.com/term/ai/r-squared
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
