Microsoft Azure AI Fundamentals (AI-900)Describe fundamental principles of machine learning on AzureHard
A data scientist is building a model to predict the price of a house based on features such as square footage, number of bedrooms, and location. The model needs to output a continuous numerical value. During the model training phase, the data scientist needs to compare the predicted house prices against the actual house prices to understand the average magnitude of error, regardless of the direction (overestimation or underestimation) of the prediction. Which evaluation metric is most suitable for this purpose?
- AAccuracy
- BR-squared (R²)
- CRoot Mean Squared Error (RMSE)
- DMean Absolute Error (MAE)
Show answer & explanationAnswer & explanation
Correct answer: D. Mean Absolute Error (MAE)
Mean Absolute Error (MAE) calculates the average of the absolute differences between predicted and actual values. It directly measures the average magnitude of errors without considering their direction, which is precisely what is needed here.
Why the other options are wrong
- A. Accuracy is a classification metric and is not applicable for regression tasks that predict continuous values.
- B. R-squared measures the proportion of variance in the dependent variable that can be predicted from the independent variables, not the average error magnitude.
- C. RMSE squares the errors before averaging, penalizing larger errors more heavily, and its units are not directly comparable to the target variable.
Mean Absolute Error (MAE)
Mean Absolute Error (MAE) is a regression metric that measures the average magnitude of the errors in a set of predictions, without considering their direction. It is the average of the absolute differences between the predicted values and the actual values.
- Calculated as (1/n) * Σ |actual - predicted|.
- Units are the same as the target variable.
- Less sensitive to outliers than RMSE.
- Provides a clear interpretation of average error magnitude.
Memory trick: Regression errors: 'MAE' is simple average, 'RMSE' is squared, 'R²' is variance explained.