The coefficient of determination, written as or sometimes , measures how well a regression model accounts for variation in the dependent variable. A value closer to usually indicates a better fit to the evaluated data.
How Is It Calculated?
In machine learning, compares the model's prediction errors with the errors produced by a simple baseline that always predicts the mean:
Here, is an actual value, is its predicted value, and is the mean of the actual values. The numerator is the , while the denominator is the total variation around the mean.
For example, suppose the actual values are , with mean , and the predictions are :
Therefore, . The model accounts for of the variation relative to the mean-value baseline.
When comparing models, calculate on the same test dataset because scores from different datasets are not directly comparable. Training data measures how closely the model fits examples it has already seen; test data better indicates generalization. However, alone does not show the typical size or direction of prediction errors. Examine residuals and other evaluation metrics where appropriate.
| Value of | Interpretation |
|---|---|
| Predictions perfectly match the observed values. | |
| Between and | The model performs better than predicting the mean. |
| The model performs no better than the mean baseline. |
A common misconception is that must lie between and . It can be negative, especially when evaluating an unsuitable model on unseen test data. A high also does not prove causation or successful generalization; overfitting may produce a high training score but a lower test score.
IB Exam Technique
For A4.3, define , interpret it relative to the mean baseline, and evaluate model fit using test data. Do not claim that a high value automatically means the model is reliable.