Databricks Machine Learning Associate Question 132
Select 3You are managing models in a Databricks MLflow registry and need to programmatically transition a specific model version from the 'Staging' stage to the 'Production' stage using the MLflow Client API. Which of the following steps are required to successfully perform this operation?
- A
Instantiate an MLflowClient object to interact with the model registry.
- B
Retrieve the model's artifact location using the MLflowClient API.
- C
Use the MLflowClient's transition_model_version_stage method to update the model's stage.
- D
Set the model's new stage using the MLflowClient's set_model_version_tag method.
- E
Provide the model name, version, and destination stage as arguments when transitioning the model's stage.
Show answer and explanation
Correct answers: A, C, E
Explanation
To transition a model's stage programmatically using the MLflow Client API, you need to instantiate an MLflowClient object, use the transition_model_version_stage method, and provide the necessary arguments such as the model name, version, and destination stage. Other operations like retrieving artifact locations or setting tags are not relevant to transitioning a model's stage.
- A. Correct.
Correct. To interact with the MLflow model registry programmatically, you first need to instantiate an MLflowClient object.
- B. Incorrect.
Incorrect. Retrieving the model's artifact location is not required to transition its stage.
- C. Correct.
Correct. The transition_model_version_stage method is used to update the stage of a model version in the MLflow model registry.
- D. Incorrect.
Incorrect. The set_model_version_tag method is used to add tags to a model version, not to transition its stage.
- E. Correct.
Correct. When transitioning a model's stage, you must specify the model's name, version, and the target stage (e.g., 'Production').