# Mean absolute error > The average loss per example when L1 loss is used. Calculate MAE as follows:[^1] The average loss per [example](https://wiki.g15e.com/pages/Example%20(machine%20learning.txt)) when [L1 loss](https://wiki.g15e.com/pages/L1%20loss.txt) is used. Calculate MAE as follows:[^1] 1. Calculate the L1 loss for a [batch](https://wiki.g15e.com/pages/Batch%20(machine%20learning.txt)). 2. Divide the L1 loss by the number of examples in the [batch](https://wiki.g15e.com/pages/Batch%20(machine%20learning.txt)). $$ \text{MAE} = \frac{1}{n}\sum_{i=0}^{n} | y_i - \hat{y}_i | $$ where: - $n$ is the number of [examples](https://wiki.g15e.com/pages/Example%20(machine%20learning.txt)). - $y$ is the actual value of the [label](https://wiki.g15e.com/pages/Label%20(machine%20learning.txt)). - $\hat{y}$ is the value that the [model](https://wiki.g15e.com/pages/Model%20(machine%20learning.txt)) predicts for $y$. ## See also - [Mean squared error](https://wiki.g15e.com/pages/Mean%20squared%20error.txt) - [Root mean squared error](https://wiki.g15e.com/pages/Root%20mean%20squared%20error.txt) ## Footnotes [^1]: https://developers.google.com/machine-learning/glossary#MAE