easyMultiple Choice
MLA-C01 Practice Question: A machine learning engineer needs to split a…
A machine learning engineer needs to split a dataset for binary classification where the positive class represents only 2% of the data. Which data splitting strategy ensures that both training and test sets maintain the same class proportion as the original dataset?
⚠ Common exam trap
MLA-C01 often tests the misconception that any random split preserves class proportions, but with imbalanced data, random splits can easily distort the minority class distribution, making stratified sampling the only reliable choice.
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
✓
Stratified sampling based on the target variable
Stratified sampling explicitly preserves the class distribution of the original dataset in each split. For a binary classification problem with a 2% positive class, stratification ensures that both the training and test sets contain approximately 2% positive examples, preventing a scenario where random chance could yield a test set with zero or very few positives. This is critical for imbalanced datasets because it maintains representativeness and allows reliable evaluation of metrics like recall or F1-score 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.
- ✓
Stratified sampling based on the target variable
Why this is correct
Stratified sampling partitions rows so each split preserves the original 2% positive-class prevalence, preventing a random split from yielding a test set with zero or distorted minority cases. This directly satisfies the stem's constraint that training and test sets mirror the dataset's class proportion, which matters acutely at severe imbalance.
- ✗
Time-series split respecting the timestamp order
Why it's wrong here
A time-series split partitions chronologically, preserving temporal order to prevent leakage, but it does not enforce matching class ratios between train and test. It is tempting because it is mandatory when observations are autocorrelated, yet stratification is the requirement here.
- ✗
Simple random split with a 80/20 ratio
Why it's wrong here
A simple random split samples independently, so with a 2% positive rate the test set can easily contain very few or zero positives, and proportions drift between splits. It is tempting because it is the default, and it suffices when classes are balanced and the dataset is large.
- ✗
K-fold cross-validation without stratification
Why it's wrong here
Unstratified K-fold draws folds randomly, so a 2% positive class can be absent or over-represented in individual folds, breaking the required proportion match. Stratified K-fold preserves class ratios per fold. Plain K-fold suits balanced datasets where random partitioning already mirrors the overall distribution.
Go deeper
Related to this question
About these practice questions
This MLA-C01 question is part of Courseiva's 665-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
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.