MLS-C01 Count encoding Practice Question
A team is analyzing a dataset with many categorical features. They notice that one feature has 1,000 unique values but a long tail where most values appear only once. Which encoding method is most appropriate to avoid overfitting?
⚠ Common exam trap
Candidates may assume one-hot encoding is always safe, but with high cardinality it creates many dummy features, increasing the risk of overfitting on rare categories.
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
✓
Count encoding
Count encoding uses the frequency of each category as its encoded value, which captures information for rare categories without increasing dimensionality. One-hot encoding (C) would create 1,000 columns, leading to high dimensionality and potential overfitting. Target encoding (A) uses the target variable mean, which can cause overfitting especially with rare categories. Label encoding (B) imposes an arbitrary ordinal relationship, which is inappropriate for nominal categorical features.
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
Why it's wrong here
Target encoding can cause overfitting, especially with rare categories.
- ✗
Label encoding
Why it's wrong here
Label encoding imposes ordinal relationships that may not exist.
- ✗
One-hot encoding
Why it's wrong here
One-hot encoding would create too many features and lead to sparsity.
- ✓
Count encoding
Why this is correct
Count encoding replaces categories with their frequency, reducing dimensionality and handling rare values.
Go deeper
Related to this question
About these practice questions
This MLS-C01 question is part of Courseiva's 1,672-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 MLS-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 MLS-C01 exam.