hardMultiple Choice
MLA-C01 Practice Question: A machine learning engineer is using Amazon…
A machine learning engineer is using Amazon SageMaker Data Wrangler to prepare a dataset with a categorical feature that has over 5,000 distinct values (high cardinality). The engineer needs to transform this feature into a form suitable for a gradient boosting model while preserving as much information as possible. Which transform should be applied?
⚠ Common exam trap
The trap is defaulting to one-hot encoding as the 'standard' categorical transform — candidates miss that with 5,000 categories it causes dimensionality explosion, and overlook target encoding's leakage risk if not done out-of-fold.
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 with smoothing
Target encoding with smoothing is the best choice for high-cardinality categorical features in gradient boosting models. It replaces each category with a smoothed statistic (typically the mean of the target for that category), which preserves predictive information while avoiding the dimensionality explosion of one-hot encoding. Smoothing blends the category mean with the global mean to prevent overfitting on rare 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
Label encoding assigns an arbitrary integer per category, which gradient boosting trees interpret as an ordered numeric magnitude, fabricating false ordinal relationships across 5,000 values. It suits low-cardinality ordinal features or tree models where category order is genuinely meaningful, not high-cardinality nominal data.
- ✓
Target encoding with smoothing
Why this is correct
Target encoding with smoothing maps each of the 5,000 categories to a smoothed target statistic, producing one compact numeric column. Smoothing blends category means toward the global mean, preventing overfitting on rare categories and preserving information for the gradient boosting model.
- ✗
One-hot encoding
Why it's wrong here
One-hot encoding creates one binary column per distinct category, so 5,000 values produce 5,000 sparse features, exploding dimensionality and sparsity for the gradient boosting model. It is the standard choice for low-cardinality categoricals, where it preserves all category information without this dimensional penalty.
- ✗
Drop the feature
Why it's wrong here
Dropping the feature discards all predictive signal from the categorical variable, contradicting the requirement to preserve as much information as possible. Removal is chosen when a column is leaky, corrupted or wholly redundant; here a target or frequency encoding retains the cardinality information the model needs.
Go deeper
Related to this question
About these practice questions
Courseiva writes every MLA-C01 question from scratch — 665 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
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.