Databricks Machine Learning Associate exam dumps

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

Single answer

A data scientist is using Databricks to manage machine learning models. They want to add metadata to a registered model in the MLflow Model Registry to indicate the environment it is intended for (e.g., 'staging' or 'production'). Which of the following code snippets correctly sets a tag for this purpose?

  1. A

    mlflow.set_tag('environment', 'staging')

  2. B

    mlflow.log_param('environment', 'staging')

  3. C

    from mlflow.tracking import MlflowClient; MlflowClient().set_registered_model_tag('model_name', 'environment', 'staging')

  4. D

    from mlflow.tracking import MlflowClient; MlflowClient().set_tag('run_id', 'environment', 'staging')

Show answer and explanation

Correct answer: C

Explanation

In Databricks and MLflow, tags can be used to add metadata to different entities. To set a tag for a registered model in the MLflow Model Registry, you must use the set_registered_model_tag method from the MlflowClient class. This method allows you to associate metadata with a registered model, such as its intended environment ('staging', 'production', etc.). The other options are either for logging run-specific metadata or use incorrect methods for setting tags.

  • A. Incorrect.

    This option is incorrect because mlflow.set_tag is used to set tags for a specific run, not for a registered model in the Model Registry.

  • B. Incorrect.

    This option is incorrect because mlflow.log_param logs a parameter for a run, which is unrelated to setting tags on a registered model.

  • C. Correct.

    This option is correct because MlflowClient().set_registered_model_tag is the appropriate method for adding a tag to a registered model in the MLflow Model Registry. The method requires the model name, the tag key, and the tag value.

  • D. Incorrect.

    This option is incorrect because MlflowClient().set_tag is used to set tags for runs and requires a run ID, not for registered models in the Model Registry.

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