The easiest way to understand MSE-Mean squared error value.

selva raj
4 min readJun 18, 2021

Today, Through this topic, we are going to explore the critical statistical concept of MSE which is inevitable when it comes to the Analytics. As a new competitor in the field of data science I admired about the beauty and facts behind in MSE calculations. Let’s see how it is going to help to fix accuracy of model that we developed in any machine learning projects.

Even though the main of this article is to clarify about MSE, I want to give a short note about what is machine learning? and projects? since I used the word in above paragraph.

Simply! Machine learning is nothing but machine is going to learn through the data and information's we feed in the form of observations by algorithms.

For instance, If we try to teach alphabets to our child. We teach them from A-Z. we point out to them each and every alphabets one by one ,sometimes randomly and it is considered to be training process. Keep in mind that we as a parents not going to make mistakes since we knew it well. But we should not expect the same from our Child as immediately.

The very next day, you do call your child, pointing them any alphabet and ask them what it is? If it is ‘B’ and child is saying it is ‘P’ because literally same and can we say it 70% accuracy. Ask one more time, now the answer will be ‘K’,low accuracy or completely wrong prediction. Repeat the same process ,until child predicts the correct answer all the time or maximum attempts.

Note: keep in remember, that number of attempts we have taken to teach them while training them is actual and and their number of correct attempts will be predicted and wrong answers will be error value.

Note : In real — time projects 100% accuracy is not possible.(Even, twins has some difference in natural).

okay! come to the point of what is MSE?

In statistical, MSE is defined as the square value of difference of actual value and predicted value.

to make you understand better ,let me show you my simple work on excel in which I have done the same child learning instance.

From the above picture we can say that total of squared error is 49.But we need mean of squared error. So again the beauty of math comes into picture.

mean squared error=total of observations/num.of observations in other term it can be called as average.

MSE=49/11=4.4545

Observations:

  1. All errors in the above example are in the range of 0 to 4 except 1, which is 5. As we square it, the difference between this and other squares increases. And this single high value leads to higher mean. So MSE is influenced by large deviators or outliers.
  2. Taking square value for all error values is necessary in order to convert it positive if there is negative value in forecasted. I have missed to denote negative value in chart but in real time projects not all forecasted values are positive. As we take a square, all errors are positive, and mean is positive indicating there is some difference in estimates and actual. Lower mean indicates forecast is closer to actual.

As this can indicate how close a forecast(child answered)or estimate(we asked)is to the actual value, this can be used as a measure to evaluate models in Data Science.

Note: In this case, its up to your decision as a parent are you going to stop the process with this accuracy you got or continue work for more.

RMSE = SQRT(MSE)

This is also used as a measure for model evaluation. There are other measures like MAE, R2 used for regression model evaluation. Let us see how these compare with MSE or RMSE

Mean Absolute Error (MAE) is the sum of the absolute difference between actual and predicted values.

R2 or R Squared is a coefficient of determination. It is the total variance explained by model/total variance.

(Thanks to Ms. Swati Deval -Great learning for this wonderful comparison chart)

RSME is always greater than or equal to MAE (RSME >= MAE).that indicates a model is good and well defined.

Conclusion

MSE is used to check how close estimates or forecasts are to actual values. Lower the MSE, the closer is forecast to actual. This is used as a model evaluation measure for regression models and the lower value indicates a better fit.

Seriously I am not a good writer but I badly wanted to be!! Sounds from claps will induced anybody to do more. Thank you..

--

--