MLA-C01 Data Preparation for Machine Learning Practice Question
A company runs an online retail business and wants to build a product recommendation system. They have a dataset of customer purchases stored in Amazon S3 as CSV files. The dataset includes columns: 'customer_id', 'product_id', 'purchase_date', 'quantity', 'price', and 'category'. The data science team plans to use Amazon SageMaker to train a factorization machines model. During data exploration, they discover that the 'category' column has 1,200 unique values, and many categories appear only a few times. The 'product_id' column has 50,000 unique values. They want to include both features in the model. The team is concerned about the high cardinality of these features. Which approach should they take to prepare these features for the factorization machines model?
⚠ Common exam trap
It's easy for candidates to default to one-hot encoding (Option A) as the standard categorical encoding technique, not realizing that factorization machines are specifically designed to avoid that explosion by accepting raw integer indices as categorical features.
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
✓
Encode both columns as integer indices and feed them directly to the factorization machines algorithm as categorical features.
Amazon SageMaker's factorization machines algorithm natively supports categorical features encoded as integer indices (0-based). This avoids the explosion of features from one-hot encoding (which would create 51,200 columns) and leverages the algorithm's ability to learn interactions between high-cardinality features via factorized parameters, making it both memory-efficient and effective for sparse data.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Apply one-hot encoding to both 'product_id' and 'category' columns.
Why it's wrong here
One-hot encoding would create over 50,000 columns, causing memory and performance issues.
- ✗
Drop the 'category' column and only use 'product_id' since it has more granularity.
Why it's wrong here
Dropping category may reduce model quality as it provides higher-level information.
- ✓
Encode both columns as integer indices and feed them directly to the factorization machines algorithm as categorical features.
Why this is correct
Factorization machines natively handle sparse categorical data via feature interactions and do not require one-hot expansion.
- ✗
Apply principal component analysis (PCA) to reduce the dimensionality of the categorical features.
Why it's wrong here
PCA is unsuitable for categorical features and requires dense numeric input.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 835 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 →
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.