Google Professional Machine Learning Engineer

Google Professional Machine Learning Engineer

Get started today

Ultimate access to all questions.


You have trained a machine learning model using data that was preprocessed in a batch Dataflow pipeline. Now, you need the model to provide real-time inference as part of a production system. To ensure accuracy and consistency in predictions, it's crucial that the data preprocessing logic used during training is applied consistently during serving as well. How can you best achieve this?




Explanation:

The correct answer is B. To ensure that the data preprocessing logic is applied consistently between training and real-time serving, it's best to refactor the transformation code in the batch data pipeline so that it can be used outside of the pipeline. By using the same code in the endpoint, you ensure that the data is preprocessed in the exact same way as it was during training, thus maintaining consistency. This is important for achieving accurate and reliable predictions in your real-time inference setup. Other options either introduce potential inconsistencies, require end-user intervention which is not ideal, or could add undesirable latency.