Assessing model's performance-Regression Algorithms

Rhythm RawatRhythm Rawat
3 min read

Model performance assessment is a crucial step in machine learning. It is essential to evaluate how well a model performs on a given dataset. In regression problems, the goal is to predict a continuous variable based on a set of input features. In this article, we will discuss different methods for assessing the performance of regression models.

Mean Absolute Error (MAE)

Mean Absolute Error (MAE) is a regression metric that measures the average absolute difference between the predicted and actual values. It is calculated as the mean of the absolute differences between the predicted and actual values:

\mathrm {MAE}= \frac {\sum _{i=1}^{n} {|y_i-x_i|}}{n}

ŷi

predicted value

xi

true value

n

total number of data points

where yi is the actual value and ŷi is the predicted value, and n is the number of observations.

MAE is a useful metric when you want to evaluate the model's performance in terms of the magnitude of errors, without considering the direction of errors. MAE is easy to interpret, as it represents the average absolute error in the same units as the target variable.

Mean Squared Error (MSE)

Mean Squared Error (MSE) is a regression metric that measures the average squared difference between the predicted and actual values. It is calculated as the mean of the squared differences between the predicted and actual values:

\mathrm{MSE} = \frac{1}{n} \sum_{i=1}^{n}(Y_{i}-\hat{Y}_{i})^2

n

number of data points

yi

observed values

ŷi

predicted values

MSE is a useful metric when you want to evaluate the model's performance in terms of the magnitude and direction of errors, as it penalizes larger errors more than smaller ones. However, MSE is not easy to interpret, as it represents the average squared error in the units of the target variable.

R-squared (R2)

R-squared (R2) is a regression metric that measures the proportion of variance in the target variable that is explained by the regression model. It is calculated as follows:

R^2 = 1 - \frac{RSS}{TSS}

coefficient of determination

RSS

sum of squares of residuals

TSS

total sum of squares

R2 ranges from 0 to 1, where 0 indicates that the model explains none of the variance in the target variable, and 1 indicates that the model explains all of the variance in the target variable. R2 is a useful metric when you want to evaluate the overall performance of the regression model, and it is easy to interpret.

Adjusted R-squared (adjusted R2)

Adjusted R-squared (adjusted R2) is a modification of R2 that penalizes the inclusion of irrelevant variables in the regression model. It is calculated as follows:

Adjusted R2 is a useful metric when you want to evaluate the overall performance of the regression model while taking into account the number of independent variables. Adjusted R2 is always lower than R2, and it increases only if the addition of a new variable improves the model fit significantly.

Conclusion

In summary, MAE and MSE are useful regression metrics that measure the magnitude and direction of errors, while R2 and adjusted R2 are useful metrics for evaluating the overall performance of the regression model. When selecting a suitable metric, it's important to consider the specific problem and the goals of the analysis.Hope you got value out of this blog. In the next blog, we will discover performance metrics used in classification model, so subscribe to the newsletter to get the new article.

Thanks :)

0
Subscribe to my newsletter

Read articles from Rhythm Rawat directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rhythm Rawat
Rhythm Rawat

Machine learning enthusiast with a strong emphasis on computer vision and deep learning. Skilled in using well-known machine learning frameworks like TensorFlow , scikit-learn and PyTorch for effective model development. Familiarity with transfer learning and fine-tuning pre-trained models to achieve better results with limited data. Proficient in Python, Machine Learning, SQL, and Flask.