Databricks Machine Learning Associate Question 467
Single answerYou are working on a Databricks notebook to register a trained machine learning model in the Unity Catalog Model Registry using the MLflow Client API. Which method should you use to ensure the model is registered to the Unity Catalog?
- A
mlflow.register_model() with a Unity Catalog path
- B
mlflow.create_model_version() with a Unity Catalog path
- C
client.create_registered_model() with a Unity Catalog path
- D
client.create_model_version() with a Unity Catalog path
Show answer and explanation
Correct answer: D
Explanation
To register a model with the Unity Catalog Model Registry using the MLflow Client API, you need to use the client.create_model_version() method. This method allows you to specify the Unity Catalog path explicitly, enabling the registration of a specific model version in the Unity Catalog. Other methods either do not support Unity Catalog paths or are intended for different purposes within MLflow.
- A. Incorrect.
mlflow.register_model() is used for registering models but does not directly allow specifying Unity Catalog paths. This method is more commonly used for the legacy MLflow model registry.
- B. Incorrect.
mlflow.create_model_version() is not a valid MLflow method for directly registering a model or creating model versions.
- C. Incorrect.
client.create_registered_model() is used to create a new registered model but does not handle the registration of model versions, which is necessary to register a model in Unity Catalog.
- D. Correct.
client.create_model_version() is the correct method for registering specific model versions to the Unity Catalog Model Registry. This allows you to specify the Unity Catalog path while interacting with MLflow's client API.