---
# System prepended metadata

title: MAE and MSE

---

# MAE and MSE

#### Mean Absolute Error(MAE):
MAE is a metric used to measure the average magnitude of errors between predicted and actual values. It is often employed in regression problems to evaluate how well a model's predictions align with the true values.

* Absolute Error: For each data point, calculate the absolute difference between the predicted value and the actual value.

* Mean Absolute Error (MAE): Take the average of these absolute differences across all data points.


MAE gives you an average of how far off your predictions are from the actual values, regardless of the direction (overestimation or underestimation). I



![Screenshot from 2023-12-12 08-43-31](https://hackmd.io/_uploads/Bym6Rfr8a.png)




#### Use Case:
Structure:
GT = [0,0,0,0,0,0]
PT = [0,0,1,1,5,5]

Note: 0,1,5 are class Label
Absolute sum of difference of each element 
```
E.g. 
|0-0| + |0-0| + |0-1|+ |0-1|+ |0-5|+ |0-5|  divided by sample size
12/6
2

MAE = 2 
```

#### Mean Squared Error(MSE):
MSE is a metric used to measure the average of the squared differences between predicted and actual values. 


![Screenshot from 2023-12-12 08-52-45](https://hackmd.io/_uploads/r1YkWmSIp.png)

The squared difference between the true and predicted values is calculated for each observation, and then the average of these squared differences is computed to obtain the MSE. Squaring the differences penalizes larger errors more than smaller ones, making it sensitive to outliers.


#### Use Case:
Structure:
GT = [0,0,0,0,0,0]
PT = [0,0,1,1,5,5]

Note: 0,1,5 are class Label
sum of squared difference of each element 
```
E.g. 
(0-0)**2 + (0-0)**2 + (0-1)**2+ (0-1)**2+ (0-5)**2+ (0-5)**2  divided by sample size
52/6
8.67

MSE = 8.67 
```


#### Normalization of the result
