Courseiva
Data Preparation for Machine LearninghardMultiple ChoiceObjective-mapped

MLA-C01 Data Preparation for Machine Learning Practice Question

A data scientist is preprocessing time series data for a fraud detection model. The data includes transaction timestamps, amounts, and merchant IDs. The model should predict fraud within seconds of a transaction. The data scientist wants to avoid data leakage by not using future information to predict past events. Which data preparation practice should be implemented?

⚠ Common exam trap

AWS often tests the concept of temporal data leakage by presenting options that seem statistically sound (like shuffling or global normalization) but violate the time series assumption, leading candidates to overlook the need for chronological feature engineering.

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

Compute features like lagged transaction amounts and rolling statistics based only on each transaction's past data up to that point.

It ensures that features are computed using only historical data available up to each transaction's timestamp, preventing any future information from leaking into the model. In time series fraud detection, using only past data for lagged amounts and rolling statistics respects the temporal order and avoids the model learning patterns that would not be available at prediction time.

Answer analysis

Option-by-option breakdown

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

  • Compute features like lagged transaction amounts and rolling statistics based only on each transaction's past data up to that point.

    Why this is correct

    This ensures no future information is used.

  • Randomly shuffle the dataset before splitting into training and validation sets.

    Why it's wrong here

    Shuffling temporal data breaks the time dependency and causes leakage.

  • Generate features such as rolling averages and lag features using a sliding window of all available data.

    Why it's wrong here

    Using all data including future to compute rolling windows causes leakage.

  • Normalize the features using MinMaxScaler on the entire dataset before splitting into training and testing.

    Why it's wrong here

    Fitting scaler on the entire dataset leaks information about future data ranges.

About these practice questions

This MLA-C01 question is part of Courseiva's 835-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 →

How Courseiva writes practice questions · Editorial policy

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.