Courseiva
Machine Learning Implementation and OperationseasyMultiple ChoiceObjective-mapped

MLS-C01 Practice Question: Machine Learning Implementation and Operations

A company is using Amazon SageMaker to build a binary classification model. The dataset is highly imbalanced, with 95% negative class and 5% positive class. Which technique should be used to address the class imbalance?

⚠ Common exam trap

Watch out — candidates often choose under-sampling (Option C) as a quick fix, but the exam tests understanding that under-sampling discards data and can hurt performance, while weighted loss preserves all data and is the preferred technique in SageMaker for imbalanced classification.

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

Use a weighted loss function during training.

Using a weighted loss function (e.g., class weights in SageMaker's built-in XGBoost or custom PyTorch loss) assigns a higher penalty to misclassifications of the minority positive class. This directly addresses the 95:5 imbalance by making the model more sensitive to the positive class during gradient updates, without discarding data.

Answer analysis

Option-by-option breakdown

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

  • Use a weighted loss function during training.

    Why this is correct

    Weighted loss penalizes errors on minority class more heavily.

  • Use accuracy as the primary evaluation metric.

    Why it's wrong here

    Accuracy can be misleading in imbalanced datasets.

  • Perform random under-sampling of the majority class.

    Why it's wrong here

    Under-sampling may discard useful information.

  • Remove all examples from the majority class.

    Why it's wrong here

    This severely reduces data and can lead to underfitting.

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 →

How Courseiva writes practice questions · Editorial policy

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.