Databricks Machine Learning Associate Question 648
Select 3You are tasked with deploying a machine learning model for real-time inference using Databricks. After deploying the model as a REST API endpoint, which of the following steps is required to query the model for predictions?
- A
Send an HTTP POST request to the endpoint with the input data in JSON format.
- B
Send an HTTP GET request to the endpoint to retrieve the model's training data.
- C
Authenticate the request using the Databricks personal access token.
- D
Send the model's feature schema along with the input data in the request payload.
- E
Include the Content-Type header as 'application/json' in the request.
Show answer and explanation
Correct answers: A, C, E
Explanation
To query a deployed machine learning model in Databricks for real-time inference, you send an HTTP POST request to the endpoint with the input data in JSON format. The request must include proper authentication (e.g., a Databricks personal access token) and the 'Content-Type' header set to 'application/json' to ensure the payload is correctly processed. GET requests and feature schema are not required for this process.
- A. Correct.
Correct. To query the deployed model for predictions, you need to send an HTTP POST request with the input data in JSON format to the endpoint.
- B. Incorrect.
Incorrect. GET requests are not used for querying models for predictions; they are typically used for retrieving static resources or information.
- C. Correct.
Correct. Authentication is required to access the Databricks model endpoint, and a personal access token is commonly used for this purpose.
- D. Incorrect.
Incorrect. The feature schema is not required in the request payload when querying a deployed model for predictions. Only the input data in the correct format is needed.
- E. Correct.
Correct. Specifying the Content-Type header as 'application/json' ensures that the server correctly interprets the input data format in the request.