Google Cloud Professional Machine Learning Engineer — Question 209

You have trained a model by using data that was preprocessed in a batch Dataflow pipeline. Your use case requires real-time inference. You want to ensure that the data preprocessing logic is applied consistently between training and serving. What should you do?

Answer options

Correct answer: B

Explanation

The correct answer is B because it ensures that the exact same transformation logic used during training is reused during inference, maintaining consistency. Option A only checks for input format without ensuring consistent processing logic. Option C involves sharing the code but does not ensure it is used in the endpoint. Option D complicates the inference process by introducing batching, which may not be suitable for real-time applications.