Calculate adjusted R-squared, which penalizes R² for added predictor variables.
Adjusted R² corrects R² for the number of predictors in the model: Adj_R² = 1 − [(1 − R²)(n − 1) / (n − k − 1)], where n is the sample size and k is the number of predictors. Plain R² can only increase (or stay the same) as more predictors are added, even useless ones, which encourages overfitting. Adjusted R² applies a penalty that grows with k, so it can decrease if a new predictor doesn't improve the model enough to justify the added complexity — making it a fairer metric for comparing models with different numbers of features.
Adj_R^2 = 1 - ((1 - R^2) * (n - 1)) / (n - k - 1)
Adding any predictor, even a random and meaningless one, gives the model more flexibility to fit the training data's specific noise, which can only reduce or maintain the residual sum of squares — never increase it — so R² is biased toward preferring more complex models.
Yes, and it always will be lower than or equal to R² whenever k > 0; if a predictor doesn't add enough explanatory power to offset the complexity penalty, adjusted R² will decrease even as raw R² stays flat or rises slightly.
Prefer the model with the highest Adjusted R² among candidates with different numbers of predictors, since it accounts for the tradeoff between explanatory power and model complexity, unlike raw R² which always favors more predictors.