Courseiva
Exploratory Data AnalysiseasyMultiple ChoiceObjective-mapped

MLS-C01 Exploratory Data Analysis Practice Question

During EDA, a data scientist finds that a categorical feature 'city' has 500 unique values but only 10 cities account for 90% of the data. What is a recommended way to handle the 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

Group rare categories into a single 'Other' category.

Grouping rare categories into 'Other' reduces cardinality, avoids overfitting from high-dimensional sparse features, and retains the majority of data from the top 10 cities. Option B (label encoding) is not recommended as it imposes an arbitrary ordinal relationship that may mislead the model. Option C (one-hot encoding all 500 categories) would create 499 dummy features, leading to the curse of dimensionality and sparse data. Option D (dropping rows with rare categories) discards potentially valuable data and may introduce bias.

Answer analysis

Option-by-option breakdown

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

  • Group rare categories into a single 'Other' category.

    Why this is correct

    Reduces cardinality and retains data.

  • Apply label encoding to all categories.

    Why it's wrong here

    Label encoding may not handle rarity well.

  • One-hot encode all 500 categories.

    Why it's wrong here

    Too many dummy variables.

  • Drop all rows with rare categories.

    Why it's wrong here

    Loses data.

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 →

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.