MLA-C01 Question 99
Select 3You are training a machine learning model to classify customer reviews as positive or negative for an e-commerce platform. However, the dataset is imbalanced, with 90% of the reviews being positive and only 10% negative. Additionally, the dataset includes numeric features (e.g., review length), text data (e.g., review content), and a small number of product images. Which strategies can you apply to address class imbalance across the dataset while ensuring the model generalizes well?
- A
Generate synthetic text reviews for the minority class using techniques like conditional generative adversarial networks (GANs).
- B
Oversample the minority class by duplicating existing negative reviews in the dataset.
- C
Use weighted loss functions during model training to penalize incorrect predictions on the minority class more heavily.
- D
Reduce the number of positive reviews in the dataset through random undersampling until the classes are balanced.
- E
Generate synthetic images for the minority class by using data augmentation techniques such as rotation, flipping, and cropping.
Show answer and explanation
Correct answers: A, C, E
Explanation
To address class imbalance in numeric, text, and image datasets, it is critical to use strategies that either generate synthetic, realistic data for the minority class (e.g., GANs for text or augmentation for images) or modify the training process to emphasize minority class samples (e.g., weighted loss functions). These approaches ensure the model generalizes well while avoiding overfitting or losing valuable information, which can happen with oversampling or undersampling techniques.
- A. Correct.
Generating synthetic text reviews using advanced techniques like conditional GANs helps to address class imbalance in text datasets by creating realistic minority samples, ensuring the model learns better representations.
- B. Incorrect.
Simply duplicating existing reviews (oversampling) may lead to overfitting, as the model could memorize the duplicated samples without learning meaningful patterns.
- C. Correct.
Using weighted loss functions is a robust approach to address class imbalance, as it adjusts the model's focus on the minority class without modifying the dataset directly.
- D. Incorrect.
Random undersampling can lead to loss of important information from the majority class and is generally not recommended when sufficient data is available for training.
- E. Correct.
Data augmentation techniques for images, such as rotation, flipping, or cropping, can help generate synthetic samples for the minority class, which improves class balance and model generalization.