Databricks Machine Learning Associate exam dumps

Databricks Machine Learning Associate practice question 458 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 458

Select 4

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

  1. A

    Use mlflow.log_metric() to log the model's accuracy.

  2. B

    Use mlflow.log_artifact() to log the confusion matrix image as an artifact.

  3. C

    Use mlflow.log_param() to log the trained model.

  4. D

    Use mlflow.sklearn.log_model() to log the trained model.

  5. E

    Ensure the MLflow run is started with mlflow.start_run() before logging any metrics, artifacts, or models.

Show answer and explanation

Correct answers: A, B, D, E

Explanation

To manually log metrics, artifacts, and models in an MLflow run, you must first start a run using mlflow.start_run(). Metrics such as accuracy can be logged using mlflow.log_metric(). Files, such as a confusion matrix image, can be logged as artifacts using mlflow.log_artifact(). The trained model should be logged using a framework-specific method like mlflow.sklearn.log_model() for scikit-learn models. The mlflow.log_param() function is not suitable for logging models but is used for logging input parameters.

  • A. Correct.

    Correct: mlflow.log_metric() is the appropriate method for logging scalar metrics like accuracy.

  • B. Correct.

    Correct: mlflow.log_artifact() is used to log files such as images, which includes the confusion matrix image in this case.

  • C. Incorrect.

    Incorrect: mlflow.log_param() is used to log parameters (e.g., hyperparameters) and cannot be used to log models.

  • D. Correct.

    Correct: mlflow.sklearn.log_model() is the correct method to log a trained model when using scikit-learn.

  • E. Correct.

    Correct: MLflow requires the use of mlflow.start_run() to begin a run before any logging can occur.

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