the error value of two model is different, one has smallest MAE but another one have smallest MSE

I have two machine learning model, the model result different error value in MAE and MSE. M1 have smallest MAE, but M2 have smallest MSE.

Can anyone explain to me, why this happen? I also add my actual and predicted data here.

Thank You

Topic metric regression

Category Data Science


MAE gives the mean error value across all the test instances, while MSE squares the error value before taking the mean. This has the effect of making large errors penalized more strongly with MSE than with MAE.

Example: let's say that 4 instances have error 3, 4, 1, 5

  • MAE = 13/4 = 3.25
  • MSE = 51/4 = 12.75

Now suppose we add an instance with error 20:

  • MAE = 33/5=6.6
  • MSE = 451/5=90.2

Note that the MAE doubles, but the MSE is 7 times higher because the large error has more effect.

In your example, one could say that M1 is better than M2 in average but M2 is better than M1 about minimizing the largest errors (although not by much).

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.