PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice question 8 of 35
You were asked to investigate failures of a production line component based on sensor readings. After receiving the dataset, you discover that less than 1% of the readings are positive examples representing failure incidents. You have tried to train several classification models, but none of them converge. How should you resolve the class imbalance problem?
Full set: 283 questionsWith less than 1% positive examples, the dataset is severely imbalanced. This often prevents model convergence because the loss function is dominated by the majority (negative) class, providing little incentive for the model to learn the minority class patterns. Downsampling the majority class creates a more balanced training set, which helps the model learn from both classes. However, this alters the class distribution. Upweighting (a form of cost-sensitive learning) is applied to give more importance to the minority class examples, ensuring the model's predictions are calibrated to the original, real-world probability of failures and preventing the loss of information from the downsampled class. This combined approach is a robust strategy to handle severe imbalance.
A. "Generating" examples can mean naive oversampling (duplication), which risks overfitting. This option is less specific and robust than the combined downsampling and weighting strategy in C.
B. Simply changing the model architecture to a CNN does not address the fundamental data imbalance problem. The CNN would likely suffer from the same convergence failure.
D. This is extreme downsampling. Removing over 99% of the negative examples would cause a massive loss of information, likely leading to a model that generalizes poorly.
1. Google Cloud Documentation - Best practices for creating training data: In the context of tabular workflows, Google's documentation recommends resampling for imbalanced datasets: "If you have a highly imbalanced dataset, you should consider the following... Undersampling the majority class." This directly supports the "downsample" part of the correct answer.
Source: Google Cloud. (n.d.). Best practices for creating training data. Vertex AI Documentation. Retrieved from https://cloud.google.com/vertex-ai/docs/tabular-data/best-practices. See section: "Work with imbalanced data".
2. Google Cloud Documentation - Data splits and weights for tabular data: Google's documentation for AutoML Tables explains the use of a weight column to handle imbalance, which is conceptually equivalent to upweighting: "For classification models, class weights are useful when you have an imbalanced dataset... A higher weight tells the model that examples of that class are more important during the training process."
Source: Google Cloud. (n.d.). Data splits and weights for tabular data. AutoML Tables Documentation. Retrieved from https://cloud.google.com/automl-tables/docs/data-splits-weights. See section: "Weight column".
3. Stanford University Courseware - CS229 Machine Learning: Course materials frequently discuss handling class imbalance. The lecture notes on "Evaluation Metrics and Imbalanced Datasets" describe modifying the loss function by weighting examples, which is a core principle behind upweighting, and also discuss the trade-offs of undersampling.
Source: Ng, A., & Katanforoosh, K. (2018). CS229 - Machine Learning: Autumn 2018. Stanford University. See lecture notes on "Practical advice for applying machine learning," which covers skewed datasets and the use of modified loss functions (weighting).
4. Academic Publication - Learning from Imbalanced Data: This highly-cited survey paper details various approaches to the class imbalance problem. It describes undersampling and cost-sensitive learning (which includes upweighting) as two primary and effective methods. The paper notes that hybrid approaches combining sampling with cost-sensitive methods are often superior.
Source: He, H., & Garcia, E. A. (2009). Learning from Imbalanced Data. IEEE Transactions on Knowledge and Data Engineering, 21(9), 1263–1284. See Sections 3.2 "Under-sampling" and 4.1 "Cost-sensitive learning". DOI: https://doi.org/10.1109/TKDE.2008.239
Keep practicing
Take the free PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice questions
- Question 1You work for an advertising company and want to understand the effectiveness of your comp…
- Question 2You developed a custom model by using Vertex Al to forecast the sales of your company s p…
- Question 3You are an ML engineer at a global shoe store. You manage the ML models for the company's…
- Question 5During batch training of a neural network, you notice that there is an oscillation in the…
- Question 6You want to rebuild your ML pipeline for structured data on Google Cloud. You are using P…
- Question 7Your team is building a convolutional neural network (CNN)-based architecture from scratc…
