nerdexam
Google

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.

Submitted by mateo_ar· Apr 18, 2026ML pipeline operationalization

Question

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?

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)
  • A
    5% (2)
  • B
    7% (3)
  • C
    17% (7)
  • D
    71% (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.

AStore a pickled model in Cloud Storage. Build a Flask-based app, package the app in a custom

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.

BBuild a Flask-based app, package the app and a pickled model in a custom container image, and

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.

CBuild a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, package it

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.

DBuild a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, and packageCorrect

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

#Vertex AI#Model Deployment#Online Inference#Custom Prediction

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice