Databricks Machine Learning Associate Question 613
Single answerYou are training a regression model to predict house prices. To stabilize the variance, you log-transform the target variable (house prices) before training the model. After the model is trained, you want to evaluate its performance using RMSE (Root Mean Squared Error) and interpret the predictions. What step should you take to ensure the evaluation metrics and predictions are meaningful?
- A
Directly calculate RMSE using the model's predictions and the log-transformed target variable.
- B
Exponentiate the model's predictions and the log-transformed target variable before calculating RMSE.
- C
Interpret the model's predictions directly as the predicted house prices without any transformation.
- D
Exponentiate the model's predictions to convert them back to the original scale of house prices before interpretation.
Show answer and explanation
Correct answer: B
Explanation
When a log transformation is applied to the target variable, the model's predictions and the target variable are both in the log scale. To calculate evaluation metrics like RMSE or to interpret predictions in the original scale, you need to exponentiate the log-transformed predictions and target variable. This step ensures that the evaluation metrics are calculated in the same units as the original target variable (house prices), and the predictions can be interpreted meaningfully.
- A. Incorrect.
Directly calculating RMSE using the log-transformed data would result in an error metric that does not correspond to the original scale and would be misleading when interpreting model performance.
- B. Correct.
Exponentiating both the predictions and the log-transformed target variable restores them to their original scale, which ensures that RMSE is calculated in the same units as the original target variable (house prices), making the metric interpretable.
- C. Incorrect.
Interpreting the model's predictions directly without transformation would lead to incorrect conclusions because the predictions are in the log-transformed scale, not the original scale.
- D. Incorrect.
While exponentiating the model's predictions is necessary for interpretation, this step alone does not ensure proper calculation of evaluation metrics like RMSE, which also requires the true target variable to be exponentiated.