Databricks Machine Learning Professional Question 210
Select 3You have deployed a machine learning model to Databricks Model Serving and registered it under the MLflow Model Registry. The model is currently in both the 'Staging' and 'Production' stages. You want to query the models in both stages to test their behavior during model evaluation and integration testing. Which of the following steps should you take to query the models in both stages?
- A
Use the REST API endpoint for the 'Production' stage to send HTTP POST requests with the required input payload.
- B
Use the REST API endpoint for the 'Staging' stage to send HTTP POST requests with the required input payload.
- C
Query the 'Staging' and 'Production' models using the same endpoint URL, as Databricks automatically determines the model stage based on the payload.
- D
Ensure that Model Serving is enabled for both the 'Staging' and 'Production' versions of the model before sending requests.
- E
Use the MLflow Python client to directly call the
mlflow.pyfunc.predictmethod on the 'Staging' model's URI.
Show answer and explanation
Correct answers: A, B, D
Explanation
To query a Model Serving-enabled model in the 'Staging' and 'Production' stages, you must use the respective REST API endpoints for each stage. Model Serving must be enabled for both stages, and HTTP POST requests should be sent with the appropriate input payload. Using different REST API endpoints ensures that you can query specific model versions deployed in distinct stages. The MLflow Python client can be used for local testing, but it does not utilize the Model Serving infrastructure.
- A. Correct.
Correct. To query the model in the 'Production' stage, you must use the REST API endpoint for the 'Production' stage and send the required HTTP POST requests with the input payload.
- B. Correct.
Correct. To query the model in the 'Staging' stage, you must use the REST API endpoint for the 'Staging' stage and send the required HTTP POST requests with the input payload.
- C. Incorrect.
Incorrect. Each stage has a separate REST API endpoint, and you cannot use the same endpoint URL to query both 'Staging' and 'Production' models. Databricks does not determine the model stage automatically based on the payload.
- D. Correct.
Correct. Model Serving must be enabled for each stage (e.g., 'Staging' and 'Production') to query the models deployed in those stages.
- E. Incorrect.
Incorrect. While you can use the MLflow Python client to call the
mlflow.pyfunc.predictmethod, this approach does not leverage Model Serving's REST API, which is the recommended method for querying models in a production or staging environment.