# mean absolute error in machine learning

When we are learning about something new, we often make mistakes. And when we make mistakes, we want to know how far off we were from being right. That's where mean absolute error comes in!

In machine learning, we use mean absolute error (MAE) to measure how wrong our predictions are. We want our predictions to be as close to the correct answer as possible, and MAE helps us see how far off we were on average.

Let's say we are trying to predict the height of a tree. We make three guesses: 10 feet, 15 feet, and 13 feet. The actual height of the tree is 12 feet. To find our MAE, we first calculate how far off each guess was from the correct answer.

- Our first guess was off by 2 feet. (10 - 12 = -2)
- Our second guess was off by 3 feet. (15 - 12 = 3)
- Our third guess was off by 1 foot. (13 - 12 = 1)

Now we need to find the average of these errors. To do this, we add up all the errors and divide by the number of guesses we made. In this case, we made three guesses, so we will divide by 3.

- (-2 + 3 + 1) / 3 = 0.666 feet

Our MAE is 0.666 feet. This means that on average, our guesses were about 0.666 feet away from the correct answer.

MAE helps us evaluate how well our machine learning model is performing. If our MAE is very high, it means our predictions are very far off and we need to work on improving our model. But if our MAE is low, it means our predictions are pretty close to the right answer and we can trust our model to give us good predictions.