PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #237
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…
The correct answer is D. Build a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, and package. To deploy an XGBoost model with custom preprocessing via a REST API within VPC Service Controls, build a custom predictor class using the Vertex AI SDK and package it with the model into a custom container for Vertex AI Prediction.
Question
Options
- AStore a pickled model in Cloud Storage. Build a Flask-based app, package the app in a custom
- BBuild a Flask-based app, package the app and a pickled model in a custom container image, and
- CBuild a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, package it
- DBuild a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, and package
How the community answered
(42 responses)- A5% (2)
- B7% (3)
- C17% (7)
- D71% (30)
Why each option
To deploy an XGBoost model with custom preprocessing via a REST API within VPC Service Controls, build a custom predictor class using the Vertex AI SDK and package it with the model into a custom container for Vertex AI Prediction.
Developing a separate Flask application for preprocessing and a separate model serving implies managing two distinct services or containers, increasing operational complexity and potential cost.
While packaging a Flask app and model into a custom container is a valid approach, utilizing the Vertex AI SDK's `CustomPredictor` class provides a more integrated and optimized solution specifically designed for Vertex AI's managed prediction services.
This option is technically very similar to D, but D is more explicitly clear about packaging *both* the custom predictor and the model into *one* custom container image, which is key for minimizing effort and cost for a single deployment.
Building a custom predictor class based on the Vertex AI SDK and packaging it with the XGBoost model into a custom container image allows both preprocessing and inference logic to run within a single managed service. This approach leverages Vertex AI's infrastructure for online prediction, integrates seamlessly with VPC Service Controls, and minimizes both cost and effort for deployment.
Concept tested: Custom container prediction on Vertex AI
Source: https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements
Topics
Community Discussion
No community discussion yet for this question.