Mean Absolute Error (MAE)
Average of absolute differences between predictions and actual values.
Formula
Variables
Example
For errors 2, -1, 3: MAE = (2+1+3)/3 = 2
How it works
Mean Absolute Error measures how far predictions are from the true values, on average, after turning each error into a positive amount. Taking the absolute value prevents positive and negative mistakes from canceling each other out, so it reflects the typical size of the miss. Dividing by the number of samples gives a single summary number that is easy to compare across models or datasets.
When to use it
Use MAE when you want an easy-to-interpret measure of average prediction error in the same units as the target, such as dollars, degrees, or units sold. It is especially useful when large errors should count, but you do not want them to dominate the metric as strongly as in squared-error measures.
Worked example, step by step
Suppose the actual values are 10, 14, and 18, and the predicted values are 12, 13, and 15. Step 1: Find each absolute error: |10 - 12| = 2, |14 - 13| = 1, |18 - 15| = 3. Step 2: Add the absolute errors: 2 + 1 + 3 = 6. Step 3: Divide by the number of samples: MAE = 6 / 3 = 2. Final answer: MAE = 2.
Common mistakes to avoid
- Forgetting the absolute value and letting positive and negative errors cancel out
- Averaging the raw errors instead of the absolute errors
- Using the wrong number of samples in the denominator
Did You Know?
MAE is more robust to outliers than MSE.
Share this formula
More in Data Science & ML
View allMean Squared Error (MSE)
BasicAverage of squared differences between predicted and actual values.
Root Mean Squared Error (RMSE)
BasicSquare root of MSE, in the same units as the target variable.
Coefficient of Determination (R²)
IntermediateProportion of variance in the target explained by the model.
Classification Accuracy
BasicFraction of predictions that are correct.
Precision
IntermediateOf all positive predictions, the fraction that were correct.
Recall (Sensitivity)
IntermediateOf all actual positives, the fraction correctly identified.