Databricks Certified Machine Learning Associate · Free Practice Question Medium

Question 9

A Data scientist has created two regression models. The first model uses price as a label variable and the second model uses log(price) as a label variable.

When evaluating the RMSE of each model by comparing the label prediction to the actual price values, the data scientist notices that the RMSE for the second model is much longer than the RMSE of the first model.

Which of the following explanations for these differences is valid?

Choose only ONE best answer.

  • A

    The second model is much more accurate than the first model.

  • B

    The data scientist failed to take the log of the predictions in the first model prior to computing the RMSE.

  • C

    The data scientist failed to exponentiate the predictions in the second model prior to computing the RMSE.

  • D

    The RMSEis an invalid evaluation metric for regression problems.

  • E

    The first model is much more accurate than the second model.

Reveal correct answer

Correct answer: C

Explanation

Correct Answer:
The data scientist failed to exponentiate the predictions in the second model prior to computing the RMSE.

Explanation:

When training a model on log-transformed labels (e.g., log(price)), the model's predictions will also be in log space. To compare these predictions to the original scale (e.g., actual price), you must reverse the transformation (exponentiate the predictions) before calculating RMSE.

Why This Matters:

  1. Model 1: Predicts price directly → RMSE is calculated on the same scale.

  2. Model 2: Predicts log(price) → Predictions must be exponentiated (exp(pred)) to match the price scale.

    • If not exponentiated: RMSE compares log(pred) to price, which is invalid (apples-to-oranges).

Example:

Why Other Options Are Incorrect:

  1. "The second model is much more accurate":

    • Invalid because the RMSE comparison is flawed (log vs. linear scale).

  2. "Failed to take the log of predictions in the first model":

    • The first model predicts price directly; no log transformation is needed.

  3. "RMSE is invalid for regression":

    • RMSE is a standard metric for regression, but scale consistency is critical.

  4. "The first model is more accurate":

    • The comparison is invalid unless predictions are on the same scale.

Key Takeaway:

For models trained on log-transformed labels:

  1. Exponentiate predictions (exp(pred)) before calculating RMSE.

  2. Compare on the original scale (e.g., price).

Impact of Skipping Exponentiation:

  • RMSE will appear artificially high because log(pred) values are much smaller than price.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need