Databricks Machine Learning Professional Question 80
Select 2You are managing a machine learning model using Databricks Model Registry. You want to add metadata to a registered model version to describe its training dataset and evaluation metrics. Which of the following steps should you take to achieve this?
- A
Use the
mlflow.register_model()function to add metadata directly at the time of registration. - B
Use the Databricks Model Registry UI to add key-value pairs as metadata to the registered model version.
- C
Use the
mlflow.set_tag()function to programmatically add metadata to the registered model version. - D
Use the
mlflow.log_param()function to log metadata as parameters during the training process. - E
Use the Databricks CLI to add metadata to the registered model version by specifying metadata properties in the CLI commands.
Show answer and explanation
Correct answers: B, C
Explanation
To add metadata to a registered model version in the Databricks Model Registry, you can either use the UI to manually add key-value pairs or programmatically use the mlflow.set_tag() function to add metadata as tags. The other options either involve unrelated functionality or are not supported methods for this purpose.
- A. Incorrect.
The
mlflow.register_model()function is used to register models with the Model Registry but does not allow adding metadata directly. Metadata must be added separately after registration. - B. Correct.
The Databricks Model Registry UI allows you to manually add metadata in the form of key-value pairs to registered models and model versions, which is a valid approach.
- C. Correct.
The
mlflow.set_tag()function allows you to programmatically add metadata (e.g., tags) to a registered model version, making it a correct option for adding metadata. - D. Incorrect.
The
mlflow.log_param()function is used to log parameters during the training process and cannot be used to add metadata to a registered model version in the Model Registry. - E. Incorrect.
The Databricks CLI does not support adding metadata to a registered model version. Metadata should be added using the UI or programmatically with the appropriate MLflow functions.