Question 676 of 835
MLA-C01 Data Preparation for Machine Learning Practice Question
A machine learning engineer is preparing a dataset that contains both numerical and categorical features. The categorical features have high cardinality (e.g., zip code with thousands of unique values). Which technique is most appropriate for encoding these high-cardinality categorical features?
⚠ Common exam trap
AWS often tests the misconception that one-hot encoding is always the safest choice for categorical data, but candidates fail to recognize that high cardinality makes it impractical, leading them to overlook target encoding as a more efficient alternative.
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
✓
Target encoding
Target encoding is the most appropriate technique for high-cardinality categorical features because it replaces each category with the mean of the target variable for that category, effectively capturing the predictive signal while keeping the feature as a single numeric column. This avoids the dimensionality explosion of one-hot encoding and the arbitrary ordinality of label encoding, making it a common choice in gradient boosting frameworks like XGBoost or LightGBM for datasets with thousands of unique categories.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Label encoding
Why it's wrong here
Assumes ordinal relationship, not suitable for nominal categories.
- ✗
One-hot encoding
Why it's wrong here
Creates too many features, leading to high dimensionality.
- ✗
Frequency encoding
Why it's wrong here
Replaces with count/frequency, may lose information.
- ✓
Target encoding
Why this is correct
Encodes using target mean, handles high cardinality well.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 30, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.