Courseiva
Question 1,218 of 1,672
Exploratory Data AnalysismediumMultiple ChoiceObjective-mapped

MLS-C01 Exploratory Data Analysis Practice Question

A data scientist is building a regression model to predict house prices. The dataset includes a feature 'zip_code' with 1,000 unique values. What is the best way to handle this categorical feature in the exploratory data analysis phase?

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 using the mean house price per zip code

Target encoding (option B) is the best approach for high-cardinality categorical features like zip_code. It captures the relationship between the category and the target variable (house price) without creating an excessive number of dummy variables. One-hot encoding (option A) would create 1,000 columns, leading to high dimensionality and sparsity. Label encoding (option D) implies an ordinal relationship, which does not exist for zip codes. Frequency encoding (option C) may not capture price variation well because two zip codes with the same frequency could have very different average prices.

Answer analysis

Option-by-option breakdown

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

  • One-hot encode the zip_code feature

    Why it's wrong here

    One-hot encoding would create too many dummy variables (1,000 columns), leading to high dimensionality and sparsity, which is not ideal for a regression model.

  • Apply target encoding using the mean house price per zip code

    Why this is correct

    Target encoding uses the mean house price per zip code, effectively capturing the relationship between zip code and the target while keeping dimensionality low.

  • Replace zip_code with the frequency of each zip code in the dataset

    Why it's wrong here

    Frequency encoding replaces categories with their occurrence counts, which may not correlate well with house prices and can lose information about price differences.

  • Use label encoding: assign each zip code a unique integer

    Why it's wrong here

    Label encoding assigns arbitrary integer values, implying an ordinal relationship among zip codes, which is not meaningful and can mislead the model.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 20, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.