What MAE (Mean Absolute Error) Meaning, Applications & Example

Mean Absolute Error, a regression evaluation metric.

What is MAE (Mean Absolute Error)?

MAE (Mean Absolute Error) is a metric used to evaluate the performance of a regression model . It calculates the average of the absolute differences between the predicted values and the actual values, giving an idea of how far off the predictions are from the true values.

Formula of MAE

\[ MAE = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i| \]

Where:

Applications of MAE

Example of MAE

import numpy as np

# Actual and predicted values
y_true = np.array([3, -0.5, 2, 7])
y_pred = np.array([2.5, 0.0, 2, 8])

# Calculate MAE
mae = np.mean(np.abs(y_true - y_pred))
print(f'Mean Absolute Error: {mae}')

Read the Governor's Letter

Stay ahead with Governor's Letter, the newsletter delivering expert insights, AI updates, and curated knowledge directly to your inbox.

By subscribing to the Governor's Letter, you consent to receive emails from AI Guv.
We respect your privacy - read our Privacy Policy to learn how we protect your information.

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z