PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice question 24 of 35

You work for a global footwear retailer and need to predict when an item will be out of stock based on historical inventory dat a. Customer behavior…

Full set: 283 questions
You work for a global footwear retailer and need to predict when an item will be out of stock based on historical inventory dat a. Customer behavior is highly dynamic since footwear demand is influenced by many different factors. You want to serve models that are trained on all available data, but track your performance on specific subsets of data before pushing to production. What is the most streamlined and reliable way to perform this validation?
Answer options
A: Use the TFX ModelValidator tools to specify performance metrics for production readiness Correct answer
B: Use k-fold cross-validation as a validation strategy to ensure that your model is ready for production.
C: Use the last relevant week of data as a validation set to ensure that your model is performing accurately on current data
D: Use the entire dataset and treat the area under the receiver operating characteristics curve (AUC ROC) as the main metric.
Correct Answer:
A. Use the TFX ModelValidator tools to specify performance metrics for production readiness
Explanation

The scenario requires a streamlined and reliable method to validate a model trained on all available data, with a specific need to track performance on data subsets before production. The TensorFlow Extended (TFX) ModelValidator component is designed for this exact purpose within a production MLOps pipeline. It automates the evaluation of a candidate model against a baseline, using a validation dataset. Crucially, it leverages TensorFlow Model Analysis (TFMA) to compute metrics on different data slices, directly fulfilling the requirement to check performance on specific subsets. This allows setting performance thresholds for these slices to automatically "bless" a model for production, making it the most streamlined and reliable approach.

Why Incorrect

B. K-fold cross-validation is a resampling method for model evaluation, but it is not ideal for time-series data due to potential data leakage and is less suited for automated pre-deployment validation.
C. Using the last week of data is a valid temporal hold-out strategy, but it is less streamlined than an integrated MLOps component and does not inherently provide the slicing and automated blessing capabilities of TFX ModelValidator.
D. Evaluating a model on the entire dataset it was trained on leads to inflated performance metrics due to overfitting and is a fundamentally incorrect validation practice.

References

1. TensorFlow Extended (TFX) Official Documentation: The ModelValidator component guide explicitly states its purpose is to "validate your model's performance on a new set of data, and helps you to understand if the model is 'good enough' to be pushed to production." It highlights its use of TensorFlow Model Analysis for "slicing-based evaluation."

Source: TensorFlow.org, "TFX Pipeline Components: ModelValidator". Section: "Using the ModelValidator Component".

2. Google Cloud Official Documentation: The documentation for Vertex AI Pipelines describes the integration of TFX components for building production-grade ML systems. It positions ModelValidator as a key step for ensuring model quality before deployment.

Source: Google Cloud, "Build a TensorFlow Extended pipeline using Vertex AI Pipelines". Section: "TFX standard components".

3. Peer-Reviewed Academic Publication: The original paper on TFX from Google researchers describes the ModelValidator as a critical component that "guards against pushing bad models to production." It specifies that the component computes metrics over "different slices of training data" to ensure performance is acceptable across important segments.

Source: Baylor, D., et al. (2017). "TFX: A TensorFlow-Based Production-Scale Machine Learning Platform." Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, p. 1388. DOI: https://doi.org/10.1145/3097983.3098021.

Scroll to Top