Databricks Machine Learning Professional Question 209
Select 3A data scientist has deployed a machine learning model in Databricks Model Registry. The model is currently in both 'Staging' and 'Production' stages, and Model Serving is enabled for both stages. The data scientist wants to query the model in the 'Production' stage via REST API. Which of the following steps are required to correctly achieve this?
- A
Send a REST API request to the endpoint URL for the Production stage.
- B
Use the Databricks access token in the Authorization header of the REST API request.
- C
Set the stage parameter in the request payload to 'Production' to specify the stage.
- D
Query the Staging endpoint first to verify the model's behavior before querying the Production endpoint.
- E
Ensure that the model is currently active and has no pending transitions in the Production stage.
Show answer and explanation
Correct answers: A, B, E
Explanation
To query a model in the 'Production' stage using Model Serving, you must send a REST API request to the specific endpoint URL for the Production stage, include the Databricks access token in the Authorization header, and ensure the model is active in the Production stage. The endpoint and stage are linked, so there is no need to specify the stage in the request payload. Querying the Staging endpoint first is optional and not a requirement for querying the Production endpoint.
- A. Correct.
This is correct because each stage (like Production) has its own unique endpoint in Model Serving, and you need to send the REST API request to the appropriate endpoint.
- B. Correct.
This is correct because the Databricks access token is required for authentication when querying the model via REST API.
- C. Incorrect.
This is incorrect because the stage parameter is not part of the request payload. The stage is automatically determined by the endpoint URL used in the query.
- D. Incorrect.
This is incorrect because querying the Staging endpoint is optional and not required for querying the Production endpoint.
- E. Correct.
This is correct because the model must be active and not in a transition state (e.g., awaiting approval) to be queryable in the Production stage.