Evaluating the Regression Models


As we have seen in the Multiple Linear Regression we chose the statistically important regressors by Backward Elimination method on the basis of Significance Level and eliminating the highest P value regressor. We at times have to face the dilemma of removing the regressor having P value just a little over the Significance Level. Here comes into play the Evaluation Parameters R Squared & Adjusted R Squared.

R Squared

The Ordinary Least Squares is also known as the Squared Sum of Residues which can be denoted mathematically as SSres = ∑ ( Yactual – Ypredicted ). The ordinary Least Squares formula is calculated by using the best fitting line in the dataset and predicted values of actual datapoints.
Now if the best fiting line is replaced by the average line then the Squared Sum of Residues is converted into Squared Total Sum and denoted by SStotal = ∑ ( Yactual – Yaverage ). Now the value of R squared can be calculated as
                                                            
                                                              R2  =  1 – ( SSres / SStotal )

Since the value of SSres is always less than or equal to SStotal for the reason that if it is higher than the later, the model would be worse than the average fitting line model and it would be of no use then. Therefore the value of R squared will always hover between 0 to 1 and the closer it is to 1, the better is the model performance. R Squared value will always increase on introduction of new independent variables or more appropriately regressors.
This is the major problem with R Squared as if we throw any non relevant variable into the model for ex – Serial Number, Telephone Number etc. its value will always rise leading us to think that the model performance is improved which is not the case. So to solve this problem Adjusted R Squared comes into play.

Adjusted R Squared

The Adjusted R Squared evaluation parameter formula can be written as

                                                     Adj. R2 = 1 – ( 1 – R2 ) [ n – 1 / n – p – 1 ]

Where n = Sample size , p = Number of Regressors

Adjusted R Squared addresses the problem with the R Squared by including a penalizing factor which keeps check on the ever increasing value of R Squared. As we increase the number of regressors the whole fractional part increases and if the newly included regressor doesn’t increase R2 appreciably, the value of ( 1 – R2) is high and Adjusted R Squared value is less and if the regressor improves R Squared greatly the value ( 1 – R2 ) is low and as a result Adjusted R Squared is high.
So that’s it for this post and from next post we will start learning yet another Machine Learning Model : Classification.
Stay Tuned ……..  

Comments

Popular posts from this blog

The Prediction Power of Machine Learning

An Informal Introduction to the Beast

Machine Learning Treasure

Preparing for the Long Journey