Courseiva
Data Preparation for Machine LearninghardMultiple ChoiceObjective-mapped

MLA-C01 Data Preparation for Machine Learning Practice Question

A machine learning team is building a model using a dataset that contains a mix of numerical and categorical features. The categorical features have high cardinality (e.g., zip code with thousands of unique values). The team wants to use Amazon SageMaker for training. Which technique should the team use to encode the high-cardinality categorical features effectively?

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

Apply target encoding (mean encoding) to the high-cardinality features.

For high-cardinality categorical features, target encoding (mean encoding) replaces each category with the mean of the target variable for that category, which captures information without creating a large number of dummy variables. One-hot encoding would create too many features. Label encoding implies ordinal relationships. Hash encoding can cause collisions.

Answer analysis

Option-by-option breakdown

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

  • Apply hash encoding to map categories to a fixed number of buckets.

    Why it's wrong here

    Hash encoding may cause collisions and lose information.

  • Apply target encoding (mean encoding) to the high-cardinality features.

    Why this is correct

    Target encoding reduces dimensionality and captures target-related information.

  • Apply one-hot encoding to all categorical features.

    Why it's wrong here

    One-hot encoding high-cardinality features creates too many columns, increasing dimensionality.

  • Apply label encoding to assign integer values to each category.

    Why it's wrong here

    Label encoding implies an order that may not exist, leading to misleading patterns.

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 →

How Courseiva writes practice questions · Editorial policy

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.