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

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.