Databricks Machine Learning Associate exam dumps

Databricks Machine Learning Associate practice question 457 of 656

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

Databricks Machine Learning Associate Question 457

Select 3

You are training a machine learning model in Databricks and want to manually log the model's accuracy, confusion matrix image, and the trained model itself using MLflow. Which of the following steps should you take within an active MLflow run?

  1. A

    Use mlflow.log_metric() to log the model's accuracy as a numeric value.

  2. B

    Use mlflow.log_artifact() to log the confusion matrix image file.

  3. C

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

  4. D

    Use mlflow.start_run() within the mlflow.log_metric() function to start a new run.

  5. E

    Use mlflow.get_artifact() to retrieve the confusion matrix image file for logging.

Show answer and explanation

Correct answers: A, B, C

Explanation

To manually log metrics, artifacts, and models in an MLflow run, you need to use the appropriate MLflow functions: mlflow.log_metric() for numeric metrics, mlflow.log_artifact() for files, and mlflow.log_model() for saving and logging models. Ensure that an MLflow run is active by using mlflow.start_run() beforehand. Incorrect usage of functions or non-existent functions, like mlflow.get_artifact(), will cause errors.

  • A. Correct.

    mlflow.log_metric() is the correct function to log scalar values like accuracy. It allows you to track numeric performance metrics for the model.

  • B. Correct.

    mlflow.log_artifact() is the correct function to log files like the confusion matrix image or any other local artifacts to the MLflow tracking server.

  • C. Correct.

    mlflow.log_model() is the correct function to save and log the trained model, making it available for further use or deployment through MLflow.

  • D. Incorrect.

    mlflow.start_run() is used to start an MLflow run, but it cannot be used directly within mlflow.log_metric() or any logging function. The run must already be active for logging to work.

  • E. Incorrect.

    mlflow.get_artifact() does not exist in MLflow. To retrieve artifacts, you would use functions like mlflow.artifacts.download_artifacts(), but this is unrelated to logging artifacts.

Timed practice exam

Take a Databricks Machine Learning Associate practice test under exam conditions

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

Start timed exam