RMSE vs MAE: Regression Error Metrics and Norms
RMSE and MAE both measure the distance between the prediction vector and the target vector; RMSE is the l2 (Euclidean) norm and MAE is the l1 (Manhattan) norm.
A typical performance measure for regression is the root mean squared error (RMSE). It gives an idea of how much error the system typically makes in its predictions, with a higher weight for large errors. RMSE(X, h) is the cost function measured on the set of examples using your hypothesis h, where X is the dataset, h is the prediction function, and m is the number of instances in the dataset.
The mean absolute error (MAE, also called average absolute deviation) is preferred when there are many outliers. Computing the RMSE corresponds to the Euclidean norm (l2 norm), noted ||.||2, the notion of distance we are all familiar with. Computing the MAE corresponds to the l1 norm, ||.||1, sometimes called the Manhattan norm because it measures the distance between two points in a city if you can only travel along orthogonal city blocks.
In general the l_k norm of a vector with n elements is the k-th root of the sum of |v_i| to the power k. The higher the norm index, the more it focuses on large values and neglects small ones. This is why RMSE is more sensitive to outliers than MAE, though when outliers are exponentially rare, RMSE performs very well and is generally preferred.
Key points
- RMSE = l2 norm (Euclidean). MAE = l1 norm (Manhattan).
- RMSE punishes large errors more.
- Higher norm index focuses on large values and neglects small ones.
- With many outliers consider MAE.
- m is the number of instances in the dataset.
Worked example
Errors of 1, 1, 10. MAE = 4. RMSE = sqrt((1 + 1 + 100) / 3) = sqrt(34) = 5.83, larger because the 10 is weighted heavily.
Common questions
Which metric is more sensitive to outliers?
RMSE, because it squares the errors.
Which norm is the Manhattan norm?
The l1 norm, used by MAE.
Practice questions on this topic
Try these, then open the app to check your answers with explanations.
- Computing the RMSE corresponds to the Manhattan norm. It is also called the l2 norm, noted ||.||2 (or just ||.||).
- A. true
- B. false
- Both the RMSE and the MAE are ways to measure the distance between the vector of predictions and the vector of target values.
- A. true
- B. false
- The higher the norm index, the more it focuses on large values and neglects small ones.
- A. true
- B. false
- RMSE(X, h), X is the number of instances in the dataset.
- A. true
- B. false
- Scikit-Learn provides a transformer called MinMaxScaler for normalization
- A. true
- B. false
- RMSE(X, h) is the cost function measured on the set of examples using your hypothesis h.
- A. true
- B. false
Related topics
- Feature Scaling: Min-Max Normalization vs Standardization
- What is Machine Learning?
- Supervised vs Unsupervised vs Semi-supervised vs Reinforcement Learning
- Overfitting and Underfitting in Machine Learning
- Batch Learning vs Online Learning
- Confusion Matrix, Precision, Recall and F1 Score
- All topics: Machine Learning
BASMAGLY is an independent student project, not an official Delta University site. Check lectures and your instructor for the final word.