Courseiva

MLA-C01 Data Preparation for Machine Learning Practice Question

A machine learning engineer needs to split a dataset into training, validation, and test sets for a SageMaker training job. The dataset is stored in Amazon S3 as a single CSV file. The engineer wants to ensure that the splits are reproducible and that the test set is never used during training or hyperparameter tuning. Which approach should the engineer use?

⚠ Common exam trap

The trap here is assuming that SageMaker training jobs automatically split data or that using all splits in training is acceptable.

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

✓

Manually split the CSV file using a Python script with a fixed random seed, write the three splits to separate S3 prefixes, and use the training and validation prefixes in the training job, keeping the test prefix for final evaluation.

To ensure reproducibility and prevent data leakage, the engineer should split the data with a fixed random seed and store each split in separate S3 locations. The training job should only consume the training and validation sets, while the test set is reserved for final model evaluation. This is a standard best practice for ML workflows.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Manually split the CSV file using a Python script with a fixed random seed, write the three splits to separate S3 prefixes, and use the training and validation prefixes in the training job, keeping the test prefix for final evaluation.

    Why this is correct

    Using a Python script with a fixed random seed ensures reproducibility. Writing the splits to separate S3 prefixes allows the training job to access only the training and validation data, while the test set remains untouched for final evaluation. This meets all requirements.

  • ✗

    Use the SageMaker training job's built-in data splitting feature by specifying a validation split percentage in the hyperparameters.

    Why it's wrong here

    SageMaker training jobs do not have a built-in data splitting feature that automatically creates train/validation/test splits from a single file. The validation split percentage is not a standard hyperparameter. This approach would require custom code and does not guarantee a separate test set.

  • ✗

    Use SageMaker Data Wrangler to split the data into three parts and export them to S3, then use all three parts in the training job with different channels.

    Why it's wrong here

    While Data Wrangler can split data, using all three parts in the training job would expose the test set during training, violating the requirement. The test set must be held out entirely until final evaluation. This approach does not prevent leakage.

  • ✗

    Use Amazon Athena to run a query that randomly assigns rows to three splits, and store the results in S3. Then use all three splits in the training job.

    Why it's wrong here

    Athena can split data, but using all three splits in the training job again exposes the test set. Additionally, Athena's random assignment may not be reproducible without a fixed seed. This approach fails to keep the test set separate and reproducible.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva writes every MLA-C01 question from scratch — 665 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.