Question 533 of 1,672
MLS-C01 Exploratory Data Analysis Practice Question
A data engineer is preparing a dataset for training a binary classification model. The target variable is highly imbalanced (95% negative, 5% positive). The engineer needs to split the data into training and test sets while maintaining the class distribution in both sets. Which method should the engineer use?
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 stratified random sampling to split the data
Stratified random sampling ensures the proportion of classes is preserved in both training and test sets. Option A is wrong because k-fold cross-validation is a model evaluation technique, not a method for splitting data into training and test sets; using it before splitting would not guarantee class balance. Option B is wrong because oversampling should be done after splitting to avoid data leakage and ensure the test set reflects the original distribution. Option C is wrong because a simple random 80/20 split may not preserve the class distribution due to random variation, especially with imbalanced 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 k-fold cross-validation and then split the data
Why it's wrong here
Cross-validation is a training technique, not a split method.
- ✗
Oversample the minority class first, then do a random split
Why it's wrong here
Oversampling before splitting can cause data leakage from test to training.
- ✗
Perform a simple random 80/20 split
Why it's wrong here
Simple random split may not preserve class distribution.
- ✓
Use stratified random sampling to split the data
Why this is correct
Stratified split preserves class proportions in each subset.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 20, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.