Databricks Machine Learning Associate exam dumps

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

Select 4

You are training a machine learning model in Databricks and need to manually log the model’s performance metrics and the trained model itself using MLflow. Which of the following steps should you include to ensure proper logging within an MLflow run?

  1. A

    Use mlflow.start_run() to start an MLflow run before logging any metrics or artifacts.

  2. B

    Log metrics like accuracy or loss using the mlflow.log_metric() function.

  3. C

    Use mlflow.log_artifact() to log your trained model directly as an artifact.

  4. D

    Save the trained model locally and use mlflow.log_model() to log it as a model artifact.

  5. E

    End the MLflow run with mlflow.end_run() only after all logging operations are complete.

Show answer and explanation

Correct answers: A, B, D, E

Explanation

To manually log metrics, artifacts, and models in MLflow, you need to start an MLflow run with mlflow.start_run(), log metrics using mlflow.log_metric(), log the trained model using mlflow.log_model() (after saving it locally), and then end the run with mlflow.end_run(). While mlflow.log_artifact() is used to log files, it is not intended for logging trained models directly.

  • A. Correct.

    Correct: Starting an MLflow run using mlflow.start_run() is required before logging any metrics, artifacts, or models.

  • B. Correct.

    Correct: Metrics such as accuracy or loss are logged using the mlflow.log_metric() function within an active MLflow run.

  • C. Incorrect.

    Incorrect: The mlflow.log_artifact() function is used to log files like datasets or configuration files, not trained models.

  • D. Correct.

    Correct: To log a trained model as an artifact, save it locally and then use the mlflow.log_model() function.

  • E. Correct.

    Correct: Ending the MLflow run with mlflow.end_run() ensures that all logging operations are finalized and the run is properly recorded.

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