Handling Class Imbalance: SMOTE and Other Techniques
A data scientist is training a binary classifier to predict customer churn. The dataset has 10,000 samples, with 500 churners (positive class). The scientist trains a logistic regression model and obtains an F1-score of 0.6. To improve the F1-score, which approach is MOST likely to be effective?
Quick Answer
The answer is to apply SMOTE to oversample the minority class. This is correct because the dataset is severely imbalanced—only 500 churners out of 10,000 samples—causing logistic regression to bias toward the majority class, which suppresses recall and drags down the F1-score. SMOTE, or Synthetic Minority Oversampling Technique, addresses this by generating synthetic examples of the minority class through interpolation between existing instances, effectively balancing the class distribution and enabling the model to learn a more accurate decision boundary. On the AWS Certified Machine Learning Specialty MLS-C01 exam, this scenario tests your understanding of how to handle class imbalance in binary classification, a frequent topic in questions about model improvement and evaluation metrics. A common trap is choosing cost-sensitive learning or threshold tuning first, but SMOTE directly tackles the root cause of low recall by augmenting the minority class. Memory tip: SMOTE “smooths” the imbalance by creating synthetic samples, not just duplicating them.
⚠ Common exam trap
The MLS-C01 exam often tests the misconception that regularization (Option A) or dimensionality reduction (Option B) can fix class imbalance, when in fact they address overfitting and noise, not skewed class priors.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Apply SMOTE to oversample the minority class
The dataset is highly imbalanced (500 churners out of 10,000 samples, a 5% positive rate). Logistic regression trained on such imbalance tends to bias toward the majority class, resulting in low recall for the minority class and a poor F1-score. SMOTE (Synthetic Minority Oversampling Technique) generates synthetic samples for the minority class by interpolating between existing minority instances, which balances the class distribution and allows the model to learn a better decision boundary, directly improving recall and F1-score.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the regularization strength (C)
Why it's wrong here
Higher regularization reduces overfitting but does not address class imbalance.
- ✗
Apply PCA to reduce feature dimensionality
Why it's wrong here
PCA addresses multicollinearity, not class imbalance.
- ✓
Apply SMOTE to oversample the minority class
Why this is correct
SMOTE generates synthetic samples for the minority class, balancing the dataset and often improving F1-score.
- ✗
Use the original dataset without any modification
Why it's wrong here
The model is already trained; class imbalance still exists.
Go deeper
Related to this question
About these practice questions
One of 1,672 original MLS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
3 more ways this is tested on MLS-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A data scientist is training a binary classification model to predict customer churn. The dataset has 10,000 samples with 500 churners (5% positive class). Which TWO techniques should the scientist use to address the class imbalance? (Choose TWO.)
medium- ✓ A.Use SMOTE to oversample the minority class
- B.Tune the decision threshold after training
- C.Randomly undersample the majority class to match minority size
- D.Oversample the minority class by duplicating existing samples
- ✓ E.Set class_weight='balanced' in the classifier
Why A: (SMOTE) generates synthetic samples for the minority class, effectively balancing the dataset. Option E (class_weight='balanced') adjusts the loss function to penalize misclassifications of the minority class more heavily. Option B (tuning threshold after training) is a post-processing step, not a technique to address imbalance during training. Option C (random undersampling) can discard useful data, leading to loss of information. Option D (oversampling by duplication) can cause overfitting due to repeated copies of the same samples.
Variation 2. A data scientist is training a binary classification model on an imbalanced dataset (95% negative class, 5% positive class). The model currently achieves 94% accuracy but a recall of only 0.10 on the positive class. Which TWO strategies should the data scientist consider to improve recall without significantly sacrificing precision? (Choose 2.)
medium- A.Undersample the majority class to match the minority class size.
- B.Increase the regularization strength to reduce overfitting.
- ✓ C.Assign higher class weights to the positive class in the loss function.
- D.Use a deeper neural network with more layers.
- ✓ E.Oversample the minority class using SMOTE.
Why C: Assigning higher class weights to the positive class in the loss function (option C) penalizes misclassifications of the minority class more heavily, forcing the model to focus on positive examples. Oversampling the minority class using SMOTE (option E) generates synthetic positive samples, improving the model's ability to learn decision boundaries for the positive class. Both techniques directly address class imbalance without discarding data. Option A (undersampling) may remove useful negative samples, harming overall performance. Option B (increasing regularization) reduces overfitting but does not specifically improve recall. Option D (using a deeper network) may increase overfitting and does not target recall directly.
Variation 3. A data scientist is training a binary classification model on an imbalanced dataset where the positive class represents 1% of the data. The model needs to maximize recall while keeping precision above 0.7. Which sampling strategy should the data scientist use?
medium- A.NearMiss from imbalanced-learn to undersample the majority class based on distance to minority samples.
- ✓ B.SMOTE from imbalanced-learn to generate synthetic samples for the minority class.
- C.RandomUnderSampler from imbalanced-learn to undersample the majority class.
- D.TomekLinks from imbalanced-learn to remove overlapping samples.
- E.RandomOverSampler from imbalanced-learn to oversample the minority class.
Why B: (SMOTE) is correct because it generates synthetic samples for the minority class, which can improve recall without discarding data, and synthetic samples help maintain precision above 0.7 by providing more balanced training. Option A (NearMiss) undersamples majority samples based on distance, potentially discarding important data and reducing recall. Option C (RandomUnderSampler) may lose too many majority samples, harming recall and precision. Option D (TomekLinks) only removes overlapping samples, which does not sufficiently address imbalance. Option E (RandomOverSampler) duplicates minority samples, which can cause overfitting and reduce precision on unseen data.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.