PMLE Scaling Prototypes into ML Models Practice Question
You are deploying a scikit-learn model to Vertex AI for online predictions. The model requires a custom preprocessing step that transforms raw JSON input into a feature vector before calling predict. You want to minimize latency and avoid managing infrastructure. What should you do?
⚠ Common exam trap
The trap here is assuming that a pre-built scikit-learn container can execute custom preprocessing, when in fact it only serves the model's predict method and requires raw inputs to be already preprocessed.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create a custom container that includes the scikit-learn model and a Flask app that performs preprocessing and calls predict, then deploy it to a Vertex AI endpoint.
Vertex AI custom containers for prediction allow you to bundle the scikit-learn model, custom preprocessing code, and an HTTP server such as Flask. This keeps preprocessing and inference in the same process, reducing latency, and Vertex AI handles scaling and infrastructure management. Pre-built containers do not support arbitrary preprocessing, and batch prediction or model conversion would not meet the low-latency online requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Export the scikit-learn model to a TensorFlow SavedModel and deploy it with the TensorFlow pre-built container, using a preprocessing layer in the model.
Why it's wrong here
Converting a scikit-learn model to a TensorFlow SavedModel is non-trivial and often not fully supported, especially for arbitrary preprocessing logic. This approach adds unnecessary complexity and risk of conversion errors. It also does not leverage the native scikit-learn serving capabilities. The requirement is to deploy a scikit-learn model, so using a TensorFlow container is inappropriate.
- ✗
Deploy the scikit-learn model using the pre-built scikit-learn container and implement preprocessing in a Cloud Function that calls the endpoint.
Why it's wrong here
Using a pre-built scikit-learn container means the raw input is passed directly to the model's predict method without custom preprocessing. Adding a Cloud Function introduces an extra network hop, increasing latency and complexity. The Cloud Function would need to transform the input and then call the endpoint, which does not meet the requirement to minimize latency and avoid managing additional infrastructure.
- ✓
Create a custom container that includes the scikit-learn model and a Flask app that performs preprocessing and calls predict, then deploy it to a Vertex AI endpoint.
Why this is correct
Vertex AI supports custom containers for prediction, allowing you to package the model, preprocessing logic, and a web server. By building a container with a Flask app that implements the preprocessing and prediction logic, you can deploy it to a Vertex AI endpoint. This approach minimizes latency because preprocessing and prediction happen in the same process, and Vertex AI manages the infrastructure, including scaling and health checks.
- ✗
Use Vertex AI Batch Prediction with a pre-built scikit-learn container and a custom preprocessing script.
Why it's wrong here
Batch prediction is designed for offline, large-scale scoring, not for low-latency online predictions. It does not provide a real-time endpoint and cannot satisfy the online prediction requirement. While it supports custom preprocessing via a Python script, the batch nature means responses are not immediate, making it unsuitable for interactive applications.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PMLE question from scratch — 775 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.