mediumMultiple ChoiceObjective-mapped
MLA-C01 Practice Question: A machine learning engineer needs to prepare a…
A machine learning engineer needs to prepare a dataset containing customer transactions for training a fraud detection model. The dataset includes features such as transaction amount, timestamp, merchant category, and customer ID. The engineer wants to create a feature representing the average transaction amount per customer over the last 7 days. Which approach should be used in Amazon SageMaker Data Wrangler?
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
✓
Write a custom PySpark SQL query in a SQL transform that uses the `AVG` window function partitioned by customer ID and ordered by timestamp with a range between 7 days preceding and current row
SageMaker Data Wrangler supports custom SQL queries via PySpark SQL, which can compute windowed aggregations like a rolling average partitioned by customer ID over a time window. This is the most direct and scalable approach.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Write a custom PySpark SQL query in a SQL transform that uses the `AVG` window function partitioned by customer ID and ordered by timestamp with a range between 7 days preceding and current row
Why this is correct
This computes the exact rolling average per customer over a 7-day window, which is the requirement.
- ✗
Export the data to Amazon SageMaker Feature Store and use point-in-time queries with a 7-day lookback
Why it's wrong here
Point-in-time queries are for retrieving historical feature values, not for computing rolling aggregations within Data Wrangler.
- ✗
Use the built-in 'Aggregate' transform with a group-by on customer ID and average of transaction amount
Why it's wrong here
A simple aggregate loses the time window; it computes a global average per customer, not a rolling 7-day average.
- ✗
Use the 'Handle Missing' transform to fill missing values with the mean transaction amount
Why it's wrong here
This addresses missing values, not feature engineering for rolling averages.
Go deeper
Related to this question
About these practice questions
Courseiva writes every MLA-C01 question from scratch — 835 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 →
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.