Evaluating Regression: Mean Squared Error (MSE) and R-Squared
MSE and R\u00b2 are the two most common regression evaluation metrics — MSE quantifies average squared error while R\u00b2 expresses how much variance in the target the model explains.
Mean Squared Error (MSE) and RMSE
MSE = (1/n) \u03a3(y\u1d62 - \u0177\u1d62)\u00b2. Taking the square root gives RMSE, which is in the same units as the target. MSE's squaring amplifies large errors, making it useful when big mistakes are especially costly.
Computing MSE and RMSE
R-Squared (Coefficient of Determination)
R\u00b2 = 1 - (SS_res / SS_tot), where SS_res is the sum of squared residuals and SS_tot is the total variance in y. R\u00b2 = 1 is a perfect fit; R\u00b2 = 0 means the model is no better than predicting the mean.
Computing R-Squared
Adjusted R-Squared
R\u00b2 always increases when you add features, even useless ones. Adjusted R\u00b2 penalises the number of predictors: Adj.R\u00b2 = 1 - (1 - R\u00b2)(n-1)/(n-p-1), where n is sample count and p is the number of features. Prefer adjusted R\u00b2 when comparing models with different numbers of features.