Google Professional Machine Learning Engineer Question 372
Single answerGoogle Cloud PlatformYou are designing a machine learning pipeline on Google Cloud and need to ensure consistent data pre-processing between training and serving. Which approach should you take?
- A
Use TensorFlow Transform (TFT) to create a shared preprocessing pipeline for both training and serving.
- B
Manually replicate training preprocessing steps in your serving application to ensure consistency.
- C
Store preprocessed training data in BigQuery and directly query it during serving.
- D
Use separate preprocessing logic for training and serving to optimize performance.
Show answer and explanation
Correct answer: A
Explanation
Ensuring consistent data preprocessing between training and serving is critical to avoid data skew, which can degrade model performance. TensorFlow Transform (TFT) enables a shared preprocessing pipeline, ensuring the same logic and transformations are applied during both training and serving. This approach minimizes errors and maintains consistency in the machine learning pipeline.
- A. Correct.
This is the correct answer. TensorFlow Transform allows you to define a single preprocessing pipeline that can be applied consistently during both training and serving, reducing the risk of data skew.
- B. Incorrect.
Manually replicating preprocessing steps is error-prone and can lead to inconsistencies between training and serving.
- C. Incorrect.
Querying preprocessed training data in BigQuery during serving is inefficient and does not ensure consistent preprocessing logic, especially when input data changes dynamically during serving.
- D. Incorrect.
Using separate preprocessing logic for training and serving increases the risk of data skew and does not ensure consistency.