Databricks Machine Learning Professional Question 25
Select 2You are working on a machine learning project and need to programmatically deploy a model stored in MLflow to a production environment. The model is registered under the name 'customer_churn_model' in the MLflow Model Registry. Which of the following steps should you take to retrieve and load the latest production version of the model for deployment?
- A
Use the MLflow Model Registry client to fetch the latest production version of the model and its URI.
- B
Call the
mlflow.pyfunc.load_modelmethod with themodels:/customer_churn_model/ProductionURI. - C
Query the MLflow experiment metadata to identify the run associated with the latest model version.
- D
Access the MLflow Tracking Server and manually download the model artifacts.
- E
Retrieve the model version tagged as 'Production' from the MLflow Model Registry.
Show answer and explanation
Correct answers: A, B
Explanation
To programmatically deploy the latest production version of a model in MLflow, you need to use the MLflow Model Registry client to fetch the model's production URI and then load the model using mlflow.pyfunc.load_model. This ensures a seamless and automated process for retrieving and deploying the model in a production environment.
- A. Correct.
Correct. The MLflow Model Registry client allows you to programmatically fetch the latest production version of the model and its URI, which is necessary for deployment.
- B. Correct.
Correct. The
mlflow.pyfunc.load_modelmethod enables you to load the model directly using its production URI (models:/customer_churn_model/Production). - C. Incorrect.
Incorrect. Experiment metadata is not typically used to directly identify or retrieve the latest production version of a registered model.
- D. Incorrect.
Incorrect. Manually downloading artifacts from the MLflow Tracking Server is not a programmatic approach and is not recommended for production use.
- E. Incorrect.
Incorrect. While retrieving the model version tagged as 'Production' is important, this requires programmatic use of the MLflow Model Registry client and is not a standalone step.