Courseiva
Data Preparation for Machine LearninghardMultiple ChoiceObjective-mapped

SMOTE for Class Imbalance in AWS ML Engineer Associate

A machine learning engineer is preparing a dataset for a binary classification model. The dataset has a severe class imbalance (95% class A, 5% class B). The engineer wants to use Amazon SageMaker to train the model. Which data preparation technique should the engineer apply to the training dataset to address the imbalance and improve model performance?

Quick Answer

With a 95/5 split, a model can reach high overall accuracy simply by predicting the majority class almost every time, since it rarely encounters minority examples during training and has little incentive to learn what distinguishes them. SMOTE addresses this at the data level rather than the algorithm level: instead of duplicating existing minority-class rows, which would just make the model memorize the same few points, it interpolates between neighboring minority instances to create new, synthetic examples that expand what the model sees for that class. This gives training a genuinely more balanced view of both classes without discarding any majority-class data, which is why it improves the model's ability to draw an accurate boundary rather than defaulting to the majority prediction. It's worth contrasting this with simple random oversampling, which just repeats existing minority rows and can encourage overfitting to those specific points, and with random undersampling of the majority class, which balances the ratio but throws away potentially useful data. Whenever a scenario describes a severely imbalanced binary or multiclass target and asks for a data preparation fix rather than a modeling or evaluation-metric fix, a synthetic oversampling technique like SMOTE is usually the answer being tested.

⚠ Common exam trap

Many candidates confuse data preparation techniques (like SMOTE) with training-time strategies (like weighted loss functions), leading them to select option C even though the question explicitly specifies applying a technique to the training dataset before training.

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 Synthetic Minority Over-sampling Technique (SMOTE) to generate synthetic samples for the minority class.

SMOTE generates synthetic samples for the minority class by interpolating between existing minority instances, which directly addresses the severe class imbalance (95% class A, 5% class B) by creating a more balanced training dataset. This technique is particularly effective for tabular data in Amazon SageMaker, as it increases the representation of the minority class without simply duplicating existing samples, thereby reducing overfitting and improving the model's ability to learn decision boundaries for the minority class.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Apply data augmentation to the majority class by adding noise.

    Why it's wrong here

    Data augmentation is not standard for tabular data and may introduce noise.

  • Apply Synthetic Minority Over-sampling Technique (SMOTE) to generate synthetic samples for the minority class.

    Why this is correct

    SMOTE creates synthetic samples, balancing the dataset without losing data.

  • Use a weighted loss function during training to penalize misclassifications of the minority class.

    Why it's wrong here

    Weighted loss is a training technique, not a data preparation step.

  • Apply random under-sampling to reduce the majority class to match the minority class size.

    Why it's wrong here

    Under-sampling discards data and may lose important patterns.

About these practice questions

One of 835 original MLA-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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on MLA-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 company is building a fraud detection model on an imbalanced dataset (99% legitimate, 1% fraudulent). To improve recall on the minority class, they want to resample data. Which combination of techniques should they use?

medium
  • A.SMOTE on entire dataset before train/test split
  • B.Random oversampling of minority class before train/test split
  • C.Random undersampling of majority class
  • D.SMOTE on training set only

Why D: SMOTE should be applied only to the training set to avoid data leakage; evaluation must reflect the original distribution. Random undersampling may discard useful majority samples; random oversampling before split leaks information.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This MLA-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 MLA-C01 exam.