Google Cloud Professional Machine Learning Engineer — Question 225
You recently trained a XGBoost model that you plan to deploy to production for online inference. Before sending a predict request to your model’s binary, you need to perform a simple data preprocessing step. This step exposes a REST API that accepts requests in your internal VPC Service Controls and returns predictions. You want to configure this preprocessing step while minimizing cost and effort. What should you do?
Answer options
- A. Store a pickled model in Cloud Storage. Build a Flask-based app, package the app in a custom container image, and deploy the model to Vertex AI Endpoints.
- B. Build a Flask-based app, package the app and a pickled model in a custom container image, and deploy the model to Vertex AI Endpoints.
- C. Build a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, package it and a pickled model in a custom container image based on a Vertex built-in image, and deploy the model to Vertex AI Endpoints.
- D. Build a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, and package the handler in a custom container image based on a Vertex built-in container image. Store a pickled model in Cloud Storage, and deploy the model to Vertex AI Endpoints.
Correct answer: D
Explanation
The correct answer is D because it combines the necessary elements, including the custom predictor class from the Vertex AI SDK and the pickled model stored in Cloud Storage, while utilizing a built-in container image, which is efficient and cost-effective. Options A and B do not utilize the custom predictor class, which is essential for proper integration with Vertex AI. Option C, while it mentions the custom predictor, does not utilize Cloud Storage for the pickled model, leading to potential inefficiencies.