Google Cloud Professional Machine Learning Engineer — Question 174
You recently used XGBoost to train a model in Python that will be used for online serving. Your model prediction service will be called by a backend service implemented in Golang running on a Google Kubernetes Engine (GKE) cluster. Your model requires pre and postprocessing steps. You need to implement the processing steps so that they run at serving time. You want to minimize code changes and infrastructure maintenance, and deploy your model into production as quickly as possible. What should you do?
Answer options
- A. Use FastAPI to implement an HTTP server. Create a Docker image that runs your HTTP server, and deploy it on your organization’s GKE cluster.
- B. Use FastAPI to implement an HTTP server. Create a Docker image that runs your HTTP server, Upload the image to Vertex AI Model Registry and deploy it to a Vertex AI endpoint.
- C. Use the Predictor interface to implement a custom prediction routine. Build the custom container, upload the container to Vertex AI Model Registry and deploy it to a Vertex AI endpoint.
- D. Use the XGBoost prebuilt serving container when importing the trained model into Vertex AI. Deploy the model to a Vertex AI endpoint. Work with the backend engineers to implement the pre- and postprocessing steps in the Golang backend service.
Correct answer: C
Explanation
The correct answer is C because implementing a custom prediction routine with the Predictor interface allows you to incorporate the necessary preprocessing and postprocessing steps directly within the model serving architecture. Options A and B focus on using FastAPI and Docker, which may require more infrastructure management and code changes. Option D suggests relying on the Golang backend for preprocessing and postprocessing, which does not align with the goal of minimizing code changes and expediting deployment.