Databricks Machine Learning Professional exam dumps

Databricks Machine Learning Professional practice question 21 of 280

Databricks Certified Machine Learning Professional. Professional level, Databricks. Free question with the correct answer and a full explanation.

Databricks Machine Learning Professional Question 21

Select 3

You are building a machine learning model to predict house prices using Databricks, and you wish to track the training process using MLflow. You decide to manually log the model's parameters, metrics, and the trained model itself to the MLflow tracking server. Which of the following steps should you perform to ensure proper logging?

  1. A

    Use mlflow.start_run() to begin an MLflow run before logging any parameters, metrics, or models.

  2. B

    Log the hyperparameters (e.g., learning rate, number of layers) using mlflow.log_param().

  3. C

    Log the evaluation metrics (e.g., RMSE, R2 score) using mlflow.log_metric().

  4. D

    Save the trained model to a local file system and skip logging it to MLflow.

  5. E

    Use mlflow.log_artifact() to log the trained model file to the MLflow tracking server.

Show answer and explanation

Correct answers: A, B, C

Explanation

To manually log parameters, metrics, and models in MLflow, it is essential to first start an MLflow run using mlflow.start_run(). Then, parameters and metrics can be logged using mlflow.log_param() and mlflow.log_metric(), respectively. The trained model should be logged using mlflow.log_model() rather than saving it locally or treating it as an unrelated artifact. This ensures that all relevant information about the experiment is tracked and reproducible.

  • A. Correct.

    Correct: MLflow requires an active run to log information. Without starting a run using mlflow.start_run(), logging parameters, metrics, or models will fail.

  • B. Correct.

    Correct: MLflow provides mlflow.log_param() to log model hyperparameters, ensuring they are tracked in the MLflow run.

  • C. Correct.

    Correct: Metrics such as RMSE or accuracy should be logged using mlflow.log_metric() to track the model's performance during training.

  • D. Incorrect.

    Incorrect: While saving models locally can be useful, MLflow provides specific methods to log models directly for better reproducibility and tracking. Skipping this step would not utilize MLflow's full capabilities.

  • E. Incorrect.

    Incorrect: The trained model should be logged using mlflow.log_model() rather than mlflow.log_artifact(), which is designed for unrelated files or supplementary artifacts.

Timed practice exam

Take a Databricks Machine Learning Professional practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam