Courseiva
ModelingmediumMultiple ChoiceObjective-mapped

MLS-C01 Modeling Practice Question

A data scientist is working with a dataset containing categorical features with high cardinality. The scientist wants to use a tree-based model. Which encoding method should be used?

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

Label encoding

For tree-based models, label encoding (option C) is typically recommended for high-cardinality categorical features because tree models can handle integer encoding without assuming any order—they split on values, not on ordinal relationships. Ordinal encoding (option A) implies an artificial order that may not exist, potentially misleading the model. One-hot encoding (option D) creates too many dimensions. Target encoding (option B) can cause overfitting, especially with high cardinality.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Ordinal encoding

    Why it's wrong here

    Ordinal encoding assigns integers with an implied order, which can mislead tree-based models if no natural order exists. It is not the standard choice for high-cardinality features.

  • Target encoding

    Why it's wrong here

    Target encoding replaces categories with the mean of the target, which can cause overfitting, especially with high cardinality. Regularization techniques are needed to mitigate this.

  • Label encoding

    Why this is correct

    Label encoding assigns arbitrary integers to categories. Tree-based models can use these integers effectively because they split on feature values without assuming order. This avoids expanding the feature space.

  • One-hot encoding

    Why it's wrong here

    One-hot encoding creates binary columns for each category, leading to a large number of features for high cardinality, which can reduce performance and increase memory usage.

About these practice questions

Courseiva writes every MLS-C01 question from scratch — 1,672 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 →

How Courseiva writes practice questions · Editorial policy

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.