Skip to content
Statistics

What is R-squared?

R-squared, the coefficient of determination, is the proportion of variance in the target that the model explains: R² = 1 − SS_res / SS_tot. 1 is a perfect fit, 0 is no better than predicting the mean, and on new data it can even be negative.

datasciencetrivia.com

Card 1 of 259. Answer: R-squared, the coefficient of determination, is the proportion of variance in the target that the model explains: R² = 1 − SS_res / SS_tot. 1 is a perfect fit, 0 is no better than predicting the mean, and on new data it can even be negative.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

R-squared, the coefficient of determination, is the proportion of the target's variance that a regression model explains: R² = 1 − SS_res / SS_tot. SS_res = Σ (yᵢ − ŷᵢ)² is the error left after the fit, and SS_tot = Σ (yᵢ − ȳ)² the error of always predicting the mean.

Example: if SS_tot = 200 and SS_res = 50, R² = 1 − 50/200 = 0.75, so the model explains 75% of the variance. R² = 1 is a perfect fit; 0 is no better than the mean. In simple linear regression with an intercept, R² equals the squared Pearson correlation of x and y.

Follow-ups: adding a predictor never lowers training R² in least squares, so adjusted R² = 1 − (1 − R²)(n − 1)/(n − p − 1) penalizes extra predictors. On test data R² is negative when the model does worse than the mean. A high R² does not prove a model correct or causal; a low R² is normal in noisy domains.

All questions