PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #53
You have trained a model on a dataset that required computationally expensive preprocessing operations. You need to execute the same preprocessing at prediction time. You deployed the model on AI…
The correct answer is D. Send incoming prediction requests to a Pub/Sub topic. For high-throughput online prediction where preprocessing is computationally expensive, the recommended architecture is to route incoming prediction requests through a Pub/Sub topic. Pub/Sub decouples the request ingestion layer from the preprocessing and prediction pipeline…
Question
Options
- AValidate the accuracy of the model that you trained on preprocessed data.
- BSend incoming prediction requests to a Pub/Sub topic.
- CStream incoming prediction request data into Cloud Spanner.
- DSend incoming prediction requests to a Pub/Sub topic.
How the community answered
(28 responses)- A18% (5)
- B7% (2)
- C4% (1)
- D71% (20)
Explanation
For high-throughput online prediction where preprocessing is computationally expensive, the recommended architecture is to route incoming prediction requests through a Pub/Sub topic. Pub/Sub decouples the request ingestion layer from the preprocessing and prediction pipeline, enabling horizontal scaling, backpressure management, and fault tolerance. This prevents the prediction endpoint from being overwhelmed during traffic spikes. The downstream Dataflow pipeline can then apply the same preprocessing transformations used during training before forwarding the processed data to the AI Platform prediction endpoint. This pattern ensures training-serving skew is avoided (same preprocessing logic runs at both training and inference time) while accommodating the high-throughput requirement.
Topics
Community Discussion
No community discussion yet for this question.