Google Professional Machine Learning Engineer Question 209
Select 3Google Cloud PlatformYou are building a machine learning model to predict customer churn for a subscription-based service. During the model development process, you notice that the dataset contains a significant class imbalance, with 90% of the customers labeled as 'Not Churned' and only 10% labeled as 'Churned'. Which of the following steps should you take to address this issue and improve model performance?
- A
Use techniques such as oversampling the minority class or undersampling the majority class to balance the dataset.
- B
Evaluate model performance using metrics such as precision, recall, or F1-score instead of accuracy.
- C
Increase the size of the test set to ensure better evaluation of the minority class.
- D
Implement a weighted loss function to penalize misclassifications of the minority class more heavily.
- E
Remove the majority class data points to create a balanced dataset.
Show answer and explanation
Correct answers: A, B, D
Explanation
Class imbalance is a common issue in machine learning, and addressing it requires careful consideration to ensure the model performs well on the minority class without degrading overall performance. Techniques like resampling (oversampling or undersampling), using evaluation metrics suited for imbalanced data, and implementing a weighted loss function are effective strategies to handle such scenarios. Simply increasing the test set size or discarding majority class data points are not effective solutions.
- A. Correct.
Correct. Oversampling the minority class (e.g., using SMOTE) or undersampling the majority class can help balance the dataset and improve model performance on the minority class.
- B. Correct.
Correct. With imbalanced datasets, accuracy can be misleading. Metrics like precision, recall, and F1-score are better suited to evaluate model performance in such scenarios.
- C. Incorrect.
Incorrect. Increasing the size of the test set does not address the underlying class imbalance in the training data and may not improve the model's performance on the minority class.
- D. Correct.
Correct. A weighted loss function can help the model pay more attention to the minority class by assigning higher penalties to its misclassifications.
- E. Incorrect.
Incorrect. Removing the majority class data points may lead to loss of valuable information and result in an overall poor-performing model.