What is a good mae (mean absolute error) score

What is a good MAE score? (simply explained)

MAE (Mean Absolute Error) is a popular metric to use for regression machine learning models, but what is a good score? In this post, I explain what MAE is, what a good value is, and answer some common questions.

Stephen Allwright
Stephen Allwright

MAE (Mean Absolute Error) is a popular metric to use for regression machine learning models, but what is a good score? In this post, I explain what MAE is, what a good score is, and answer some common questions.

What is MAE?

MAE (Mean Absolute Error) is the average absolute error between actual and predicted values.

Absolute error, also known as L1 loss, is a row-level error calculation where the non-negative difference between the prediction and the actual is calculated. MAE is the aggregated mean of these errors, which helps us understand the model performance over the whole dataset.

MAE is a popular metric to use as the error value is easily interpreted. This is because the value is on the same scale as the target you are predicting for.

MAE mathematical formula

The formula for calculating MAE is as follows:

mathematical formula for mae (mean absolute error)

How to calculate MAE in Python

Calculating MAE is simple to implement in Python using the scikit-learn package. An example can be seen here:

from sklearn.metrics import mean_absolute_error

actual = [100,120,80,110]
predicted = [90,120,50,140]

mae = mean_absolute_error(actual, predicted)

Positives and negatives of using MAE

MAE is a popular metric to use for evaluating regression models, but there are also some disadvantages you should be aware of when deciding whether to use it or not.

Positives of using MAE

  1. Understandable for end users
  2. Value is given in terms of the target you are predicting
  3. Simple to calculate in Python

Negatives of using MAE

  1. Unless converting to MAPE, it is not comparable across datasets

What is a good MAE score?

The closer MAE is to 0, the more accurate the model is. But MAE is returned on the same scale as the target you are predicting for and therefore there isnโ€™t a general rule for what a good score is. How good your score is can only be evaluated within your dataset.

MAE can, however, be developed further by calculating the MAPE (Mean Absolute Percentage Error), which is the MAE returned as a percentage. This can make it easier to interpret your error value.

Can you compare MAE scores from different models?

MAE cannot be compared across different models and datasets. However, by converting MAE to MAPE (Mean Absolute Percentage Error), it becomes possible to compare model performance as this error is returned as a percentage.

Is a higher or lower MAE better?

The lower the MAE score the better. This is because MAE is a measure of the average error between the predictions and intended targets, thus we want to minimise this value.

What is the ideal value of MAE?

There is no ideal value for MAE as it is returned on the same scale that you are predicting, so an ideal MAE value for one dataset will not be the same for another.

What is a high MAE?

There is no high value for MAE, as MAE is returned on the same scale that you are predicting. For example, a high value when predicting basket size in a grocery store will be extremely low for a model which is predicting house prices.


Interpretation of MAE values

Metric comparisons

RMSE vs MAE, which should I use?
MAE vs MAPE, which is best?
MSE vs MAE, which is the better regression metric?

Regression metrics

Mean Squared Error (MSE)
Root Mean Squared Error (RMSE)
R Squared
Median Absolute Percentage Error (MDAPE)

Metric calculators

MAE calculator

References

Sklearn documentation for MAE

Metrics

Stephen Allwright Twitter

I'm a Data Scientist currently working for Oda, an online grocery retailer, in Oslo, Norway. These posts are my way of sharing some of the tips and tricks I've picked up along the way.

Comments