Courseiva
Data Preparation for Machine LearningeasyMultiple ChoiceObjective-mapped

MLA-C01 Data Preparation for Machine Learning Practice Question

A marketing company is preparing a dataset to train a logistic regression model to predict whether a customer will click on an online ad. The dataset includes 1 million records with features: customer_age (numeric), income (numeric), education_level (ordinal: high school, bachelor, master, PhD), and ad_category (categorical: 50 unique values). The data is stored in a CSV file in Amazon S3. The data scientist plans to use Amazon SageMaker's built-in linear learner algorithm. The data scientist needs to preprocess the data before training. What is the correct sequence of data preparation steps that should be applied to this dataset to ensure optimal model performance?

⚠ Common exam trap

A common mix-up: candidates choose label encoding for all categorical features (Option C) or target encoding (Option A) without considering the ordinal nature of education_level or the risk of data leakage, leading to suboptimal model performance.

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

Standardize customer_age and income to have zero mean and unit variance, one-hot encode ad_category, ordinal encode education_level (e.g., map to 1-4), then combine all features into a feature matrix.

It applies appropriate preprocessing for a logistic regression model using SageMaker's linear learner. Standardizing numeric features (zero mean, unit variance) is essential for linear models to ensure convergence and equal feature influence. One-hot encoding the categorical ad_category (50 unique values) avoids imposing ordinal relationships, while ordinal encoding education_level respects its natural order. This combination prepares a feature matrix suitable for the linear learner's optimization.

Answer analysis

Option-by-option breakdown

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

  • Drop any duplicate records, apply min-max scaling to all numeric features, and use target encoding for ad_category based on click rates.

    Why it's wrong here

    Target encoding risks data leakage if not done carefully; min-max scaling may not be optimal for linear learner.

  • Apply PCA to all numeric and categorical features after converting categories to numeric indices, then standardize the principal components.

    Why it's wrong here

    PCA on categorical features with arbitrary numeric mapping is inappropriate; converting age to categories loses information.

  • Apply min-max scaling to customer_age and income, label encode education_level and ad_category, then use recursive feature elimination to reduce dimensionality.

    Why it's wrong here

    Label encoding on ad_category introduces false ordinal relationships; min-max scaling is not standard for linear models.

  • Standardize customer_age and income to have zero mean and unit variance, one-hot encode ad_category, ordinal encode education_level (e.g., map to 1-4), then combine all features into a feature matrix.

    Why this is correct

    Standardization helps linear models converge faster; one-hot encoding for categorical with many categories is standard; ordinal encoding preserves the ordinal nature of education.

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 — 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 →

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.