Databricks Machine Learning Professional Question 81
Select 3You are working on a machine learning project in Databricks and have registered a model in the Model Registry. You want to add metadata to both the registered model and one specific version of the model to provide additional context, such as the use case and performance metrics. Which of the following actions will correctly accomplish this task?
- A
Use the Databricks REST API to add tags to the registered model and the specific version of the model.
- B
Use the Databricks CLI to directly modify the metadata of the specific model version.
- C
Programmatically call
mlflow.set_tag()within a Databricks notebook to add metadata to the registered model and the specific version. - D
Navigate to the Model Registry UI in Databricks and manually add metadata fields to both the registered model and the specific version.
- E
Use the
mlflow.log_param()function to log metadata for the registered model and the specific version in a Databricks notebook.
Show answer and explanation
Correct answers: A, C, D
Explanation
To add metadata to a registered model and a specific version in Databricks, you can use the Databricks REST API, the mlflow.set_tag() function programmatically, or the Model Registry UI. These methods allow you to associate tags or metadata with the model and its versions, providing additional context. However, methods like the CLI or mlflow.log_param() do not support this specific functionality.
- A. Correct.
Correct: The Databricks REST API allows you to programmatically add tags (metadata) to both the registered model and the specific version. This is a valid approach for managing model metadata.
- B. Incorrect.
Incorrect: The Databricks CLI cannot directly modify the metadata of a specific model version. While it provides other functionalities, this use case is not supported.
- C. Correct.
Correct: The
mlflow.set_tag()function can be used programmatically to add metadata (tags) to both the registered model and its specific versions. This is a common method for managing metadata in Databricks. - D. Correct.
Correct: The Model Registry UI in Databricks allows manual addition of metadata fields (tags) to both the registered model and specific versions. This is a valid approach for adding metadata.
- E. Incorrect.
Incorrect: The
mlflow.log_param()function is used to log parameters for runs, not for adding metadata to registered models or their versions. This is not a valid approach for this task.