Databricks Machine Learning Associate Question 615
Single answerYou are training a regression model to predict housing prices. To stabilize the variance, you applied a log transformation to the target variable before training the model. After making predictions on the test dataset, you calculate the Mean Absolute Error (MAE) directly using the log-transformed predictions and the log-transformed actual values. Why might this approach lead to incorrect evaluation of your model's performance?
- A
Because the log-transformed values do not represent the actual scale of the target variable.
- B
Because the log transformation introduces non-linearity, which distorts the error calculation.
- C
Because the MAE metric cannot be calculated on log-transformed data.
- D
Because MAE is only valid for binary classification problems.
Show answer and explanation
Correct answer: A
Explanation
When a log transformation is applied to a target variable in a regression problem, the predictions and actual values need to be exponentiated back to their original scale before calculating evaluation metrics like MAE. This ensures that the metrics reflect the error in terms of the original target variable, rather than the transformed scale. Failing to do so can lead to incorrect interpretations of model performance.
- A. Correct.
Correct. Log-transformed values do not represent the actual scale of the target variable, so the evaluation metrics calculated directly on these values will not reflect the true error in the original target variable's scale. To correctly evaluate, you need to exponentiate the predictions and actual values back to their original scale before calculating metrics like MAE.
- B. Incorrect.
Incorrect. While log transformation introduces non-linearity, this does not necessarily distort error calculation. The issue here is about the scale of the data, not non-linearity.
- C. Incorrect.
Incorrect. MAE can be calculated on log-transformed data, but doing so will not provide meaningful insights about the model's performance on the original target scale.
- D. Incorrect.
Incorrect. MAE is a valid metric for regression problems, not just binary classification problems.