Courseiva

MLA-C01 Data Preparation for Machine Learning Practice Question

A team is using Amazon SageMaker for feature engineering. They have a dataset with a column 'TransactionDate' in string format (e.g., '2023-01-15 10:30:00'). They need to create features: year, month, day, hour, and day_of_week. What is the most efficient way to do this in a SageMaker processing job?

⚠ Common exam trap

AWS often tests the misconception that SageMaker built-in algorithms can handle feature engineering, but they are strictly for training and inference, not data preprocessing — the trap here is assuming 'first-party algorithms' include data transformation capabilities.

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 pandas datetime functions and then split

Using pandas datetime functions within a SageMaker processing job is the most efficient approach for this task. SageMaker processing jobs run custom Python scripts, and pandas provides vectorized operations (e.g., `pd.to_datetime()`, `.dt.year`, `.dt.month`, `.dt.day`, `.dt.hour`, `.dt.dayofweek`) that parse the string column and extract all required features in a single pass without external dependencies or data movement.

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 pandas datetime functions and then split

    Why this is correct

    Pandas' `pd.to_datetime` parses the string column into datetime64 in one vectorised pass, then `.dt.year`, `.dt.month`, `.dt.day`, `.dt.hour` and `.dt.dayofweek` extract all five features directly. This satisfies the efficiency constraint by avoiding per-row Python loops or repeated parsing inside the SageMaker processing job.

  • ✗

    Use SageMaker built-in first party algorithms

    Why it's wrong here

    Built-in algorithms train or infer on numeric tensors; they cannot parse a string timestamp into year, month, day, hour and day_of_week components. They suit model training on already-prepared tabular data, whereas date decomposition requires custom Python in a SageMaker Processing job.

  • ✗

    Use AWS Glue for transformation

    Why it's wrong here

    AWS Glue runs outside the SageMaker processing job, adding a separate ETL service and orchestration step rather than transforming data within the job itself. Glue suits catalogued, scheduled ETL pipelines across data stores, not inline feature derivation inside a SageMaker Processing container.

  • ✗

    Use SQL query in Athena on S3 data

    Why it's wrong here

    Athena queries S3 data externally and returns results rather than writing features into the processing job's output. It suits ad-hoc SQL analytics over data lake tables, whereas the scenario needs date-part extraction performed inside the SageMaker Processing job itself.

About these practice questions

One of 665 original MLA-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.