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.

enter image description here

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

Thank You


1 Answer 1


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).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.