AI0-001 AI Models and Data Engineering Practice Question
A team is building a regression model to predict house prices. The dataset includes numerical features (square footage, number of bedrooms) and categorical features (neighborhood, roof type). The categorical features have high cardinality (neighborhood has 200+ unique values). Which encoding strategy should the team use to avoid overfitting and maintain model interpretability?
⚠ Common exam trap
CompTIA often tests the misconception that one-hot encoding is always safe for categorical variables, but here the high cardinality (200+ neighborhoods) makes one-hot encoding impractical and prone to overfitting, leading candidates to overlook target encoding with regularization as the correct solution.
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 regularization.
Target encoding with regularization is the best choice because it replaces each categorical value with the mean of the target variable for that category, which captures the relationship between the category and house prices. Regularization (e.g., adding a prior or using cross-validation) shrinks the encoded values toward the global mean, preventing overfitting on rare categories (e.g., neighborhoods with only a few houses). This maintains interpretability because each encoded value directly reflects the average price impact of that category, unlike black-box embeddings.
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 with regularization.
Why this is correct
Target encoding condenses categories using target mean, and regularization prevents overfitting.
- ✗
Label encoding.
Why it's wrong here
Label encoding introduces ordinal relationships that may mislead the model.
- ✗
Binary encoding.
Why it's wrong here
Binary encoding reduces dimensions but loses interpretability and may still overfit.
- ✗
One-hot encoding with feature selection.
Why it's wrong here
One-hot creates many columns; feature selection may help but still prone to overfitting with high cardinality.
About these practice questions
This AI0-001 question is part of Courseiva's 754-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 AI0-001 practice question is part of Courseiva's free CompTIA 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 AI0-001 exam.