Beginner level · Module 4: Evaluating Machine Learning Models · Lesson 1 of 3
Measuring Regression Errors
Measure how far numeric predictions are from the truth with MAE, RMSE and R².
In this lesson you will
- Calculate and interpret MAE and RMSE
- Explain what R² does and does not say
Key concepts
mean absolute errorroot mean squared errorR²error in real units
The lesson
Mean absolute error (MAE) is the average size of the errors, in the same units as the target: an MAE of 120 kg per hectare is easy to explain. Root mean squared error (RMSE) squares errors before averaging, so large mistakes count more.
R² compares the model with always predicting the average: 1 is perfect, 0 is no better than the average, and it can even be negative. A high R² does not mean predictions are accurate enough for the decision.
Always relate error to the decision: is an average error of 120 kg/ha small or large for a farmer planning sales?
Step by step
- Calculate MAE by hand for five predictions.
- Calculate MAE, RMSE and R² with scikit-learn.
- Compare the regression model with the mean baseline.
- Explain the results in plain language.
Practice activity
Evaluate the crop-yield model and write two sentences a farmer could understand about its accuracy.
Expected result: Correct metrics and a plain-language explanation of typical error.
Check your understanding
-
Which metric punishes large errors more, MAE or RMSE?
Show answer
RMSE.
-
What does an R² of 0 mean?
Show answer
The model is no better than always predicting the average.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.