MLA-C01 Question 127
Select 3You are working on deploying a machine learning model using Amazon SageMaker. The model predicts customer churn for a subscription service. During testing, you observe that the model's predictions are skewed, and the recall for the minority class (churned customers) is significantly lower than the majority class. What steps could you take to address this issue?
- A
Use class weights in the loss function to penalize misclassifications of the minority class.
- B
Increase the size of the training dataset by adding more data from the majority class.
- C
Apply oversampling techniques on the minority class to balance the dataset.
- D
Use a different evaluation metric, such as F1 score, instead of accuracy.
- E
Enable automatic hyperparameter tuning in SageMaker to optimize the model.
Show answer and explanation
Correct answers: A, C, D
Explanation
In imbalanced datasets, the model tends to favor the majority class, leading to poor performance for the minority class. To address this, you can use techniques like class weighting or oversampling to balance the representation of classes in the dataset. Additionally, using evaluation metrics like F1 score, which prioritize both precision and recall, ensures that the model's performance on the minority class is adequately assessed. Simply adding more majority class data or relying on hyperparameter tuning does not directly solve the class imbalance issue.
- A. Correct.
Using class weights in the loss function is a valid approach to address class imbalance. By penalizing misclassifications of the minority class more heavily, the model becomes more sensitive to the minority class and can improve recall.
- B. Incorrect.
Adding more data from the majority class would further exacerbate the class imbalance problem and is not a recommended approach in this scenario.
- C. Correct.
Oversampling techniques, such as SMOTE (Synthetic Minority Oversampling Technique), can help balance the dataset by increasing the representation of the minority class, which can improve model performance on that class.
- D. Correct.
Switching to an evaluation metric like F1 score, which considers both precision and recall, is a valid approach for imbalanced datasets. Accuracy is not a reliable metric when classes are imbalanced.
- E. Incorrect.
While automatic hyperparameter tuning can improve overall model performance, it does not specifically address the issue of class imbalance or the low recall for the minority class.