Databricks Machine Learning Associate Question 121
Select 3You are working on a machine learning project using Databricks and have trained a model that you want to register in the MLflow Model Registry. Which of the following steps are necessary to register the model using the MLflow Client API?
- A
Initialize an MLflow client instance and specify the tracking URI.
- B
Use the
log_modelmethod from the MLflow Client API to register the model. - C
Provide a model name when calling the
create_registered_modelmethod. - D
Use the
create_model_versionmethod to associate a model artifact with the registered model. - E
Call the
transition_model_version_stagemethod to register the model.
Show answer and explanation
Correct answers: A, C, D
Explanation
To register a model using the MLflow Client API, you must initialize the MLflow client and specify a tracking URI to interact with the Model Registry. Then, you must create a registered model using create_registered_model and associate the model artifact with this registered model using the create_model_version method. The transition_model_version_stage method is not needed for initial registration but is used to transition a model version to a specific stage.
- A. Correct.
Correct. The MLflow Client API requires initializing the MLflow client and specifying the tracking URI to interact with the MLflow Model Registry.
- B. Incorrect.
Incorrect. The
log_modelmethod is used to log a model artifact, not to register it in the Model Registry. - C. Correct.
Correct. A model name must be provided when creating a registered model using the
create_registered_modelmethod. - D. Correct.
Correct. The
create_model_versionmethod is required to link the model artifact to the registered model and create a version of it. - E. Incorrect.
Incorrect. The
transition_model_version_stagemethod is used for transitioning a model version to a specific stage (e.g., Staging or Production) but is not required for model registration.