5.1.6.2 Coefficient of Determination(R2)
R2 serves as a measure of how well a linear regression model fits the data. This statistic reveals the proportion of the variance in the dependent variable explained collectively by the independent variables. It quantifies the strength of the relationship between the independent and dependent variables, typically expressed on a scale from 0 to 1 (or 0% to 100%).
R2 assesses how closely the data points cluster around the fitted regression line, providing insight into the model's goodness of fit. R2 is mathematically represented as:
Where,
represents the sum of squared error (which we have already seen in detail in the previous sections)
represents the total sum of squares, which is the sum of the squared differences between each data point's dependent variable value and the mean of the dependent variable
represents the actual value of a dependent variable
for the
data point where
is ranging from 1 to n
represents its predicted value
is the mean of the dependent variable
- The value
represents the squared error
- The value
is the total sum of squares
R-squared is always between 0 and 100%:
- 0% represents a model that does not explain any of the variation in the response variable around its mean.
- 100% represents a model that explains all the variation in theā¦