Calculate mean absolute error between predicted and actual values.
Mean Absolute Error (MAE) is the average magnitude of prediction errors, without regard to direction: MAE = (1/n) × Σ|y_i − ŷ_i|. It's expressed in the same units as the target variable, making it easy to interpret directly (e.g. 'predictions are off by $500 on average'). Unlike MSE/RMSE, MAE weighs all errors linearly, so it's less sensitive to outliers — a few very bad predictions won't dominate the score as much as they would with squared-error metrics.
MAE = (1/n) * sum(|y_i - y_hat_i|)
MAE averages the absolute value of errors (linear penalty), while MSE averages squared errors (quadratic penalty) — MSE punishes large errors much more heavily, so MAE is more robust to outliers.
A lower MAE means predictions are, on average, closer to the actual values — MAE of 0 would mean perfect predictions with no error at all.
Yes — MAE is expressed in the same units as the target, so a MAE of 5 means something very different when predicting house prices in dollars versus predicting a 0-1 probability; use MAPE for a scale-independent alternative.