AI0-001 AI Models and Data Engineering Practice Question
A data scientist is preparing a dataset for a classification model. The dataset contains several categorical variables with high cardinality. Which TWO encoding methods are appropriate for converting these categorical variables into numerical features?
⚠ Common exam trap
Candidates may incorrectly discard label encoding (option E) because they assume it always imposes an ordinal relationship, but in many classification contexts (e.g., tree-based models) label encoding can handle high-cardinality nominal variables without issue. The trap is to overgeneralize the rule against label encoding, even when the question lists it as a correct answer alongside one-hot encoding.
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
✓
One-hot encoding
One-hot encoding is appropriate for high-cardinality categorical variables because it creates binary columns for each category, allowing the model to treat each category as an independent feature without imposing an ordinal relationship. This is crucial for classification models that assume numerical inputs, as it prevents the model from misinterpreting arbitrary integer labels as having meaningful order or magnitude.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Min-max scaling
Why it's wrong here
Min-max scaling is a normalization method for numerical features, not for encoding categorical variables.
- ✗
K-means clustering
Why it's wrong here
K-means is a clustering algorithm, not an encoding technique.
- ✓
One-hot encoding
Why this is correct
One-hot encoding converts each category into a binary vector, suitable for categorical variables.
- ✗
Principal component analysis (PCA)
Why it's wrong here
PCA is a dimensionality reduction technique, not an encoding method.
- ✓
Label encoding
Why this is correct
Label encoding assigns a unique integer to each category, appropriate for ordinal or high-cardinality categorical variables.
About these practice questions
One of 754 original AI0-001 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.