Explained Variance Calculator
Calculate the explained variance score between actual and predicted values for a regression model.
Inputs
Comma-separated actual (true) values.
Comma-separated predicted values, same order and count as actual.
Explained Variance Score
0.9572
Residual Variance
0.3125
Actual Value Variance
7.2969
Step by step
Residuals: y_i − ŷ_i
y − ŷ
= [0.500, -0.500, 0.000, -1.000]
Variance of residuals: Var(y − ŷ)
Var(residuals)
= 0.3125
Explained variance: 1 − Var(y − ŷ) / Var(y)
1 − (0.3125 ÷ 7.2969)
= 0.9572
How it works
The explained variance score measures how much of the variance in the actual values is captured by the model, ignoring any constant bias: EV = 1 − Var(y − ŷ) / Var(y). It's closely related to R², but R² also penalizes systematic bias (a constant offset between predictions and actuals), while explained variance only looks at how well the model captures the spread of the data. A score of 1.0 means the model perfectly explains all variability, and 0.0 means it explains none.
Formula
EV = 1 - Var(y - y_hat) / Var(y)
- Var(y - \hat{y})
- Variance of residuals
- Var(y)
- Variance of actual values
Frequently Asked Questions
How is explained variance different from R²?
R² penalizes both variance mismatch and any systematic bias (mean offset) between predictions and actuals, while explained variance only measures variance mismatch — if a model's predictions are shifted by a constant amount but track the actual values' ups and downs perfectly, explained variance would still be close to 1 even though R² would be lower.
Can explained variance be negative?
Yes — like R², if the residual variance is larger than the variance of the actual values themselves, explained variance becomes negative, indicating the model performs worse than a naive constant prediction in terms of capturing variability.
When should I prefer explained variance over R²?
Use explained variance when you specifically care about whether the model captures the pattern/spread of the data and are less concerned about a constant systematic bias, which some post-processing or calibration step could correct separately.