R-Squared
Table of contents
Coefficient of Determination
Coefficient of determination (
So essentially, goodness of fit.
To understand
Explained Variation
In cases like linear regression with OLS, we have seen that the following decomposition is true:
Since we want to know how much of the variation is explained by the model, we solve for the proportion of the explained variation among the total variation.
This is the definition of
Interpretation
If the model captures all the variation in the dependent variable, the variation caused by error (
The baseline model, which is just the mean of the dependent variable, results in
Any model that performs worse than the baseline model will have a negative
So generally, the higher the
Anything below 0 means you should really reconsider your model or check if you have a mistake, because you’re doing worse than the bare minimum which is just always predicting the mean.
Just because a model has a high
Relationship with Correlation
Review correlation from here.
The Pearson’s correlation coefficient
For simple linear regression models,
Adjusted
The issue with regular
When you add more predictors/features to your model,
This is because as your model gets more complex, the
Remember
but
Intuition
Think of what it means to increase the complexity of the model.
You had just a rigid line to fit your model before, but now you’ve added some features in so that it’s more flexible to fit a more complex curve.
You should have been able to decrease your error squares, so
This results in multiple issues:
is a positively biased estimator (always overshoots)- Bias towards complex models
- Overfitting
Adjustment
To account for the bias, we penalize the
The penalty is defined as:
where
Notice that the penalty is 1 when
Remembering that
We can penalize
Through substitution, we get the definition for adjusted