MLA-C01 Data Preparation for Machine Learning Practice Question
A data scientist is preparing a dataset for a regression model that predicts house prices. The dataset includes a `neighborhood` feature with 500 distinct categories. The data scientist wants to encode this feature without increasing dimensionality too much and while capturing the target relationship. Which encoding technique should be used?
⚠ Common exam trap
AWS often tests the trade-off between dimensionality and information retention, and the trap here is that candidates may choose one-hot encoding out of habit, failing to recognize that 500 categories make it impractical, or choose label encoding because it seems simple, ignoring the ordinal assumption it imposes.
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 (mean encoding)
Target encoding (mean encoding) is the correct choice because it replaces each of the 500 neighborhood categories with the mean of the target variable (house price) for that category. This captures the relationship between the neighborhood and the target while adding only one new feature column, thus avoiding the massive dimensionality explosion that would occur with one-hot encoding (which would create 500 binary columns).
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Target encoding (mean encoding)
Why this is correct
Target encoding captures target relationship with low dimensionality.
- ✗
One-hot encoding
Why it's wrong here
One-hot encoding creates excessive dummy variables.
- ✗
Frequency encoding
Why it's wrong here
Frequency encoding uses counts, not target information.
- ✗
Label encoding
Why it's wrong here
Label encoding imposes an artificial order.
Go deeper
Related to this question
About these practice questions
This MLA-C01 question is part of Courseiva's 835-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.