Courseiva
mediumMultiple ChoiceObjective-mapped

MLA-C01 Practice Question: A data scientist is building a regression model…

A data scientist is building a regression model to predict house prices. The dataset contains a feature 'neighborhood' with 500 distinct values, and most neighborhoods have fewer than 10 samples. Which approach is MOST appropriate for handling this high-cardinality categorical feature?

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

Use target encoding with proper cross-validation to avoid data leakage

Target encoding replaces each category with the mean target value, which is effective for high-cardinality features while maintaining predictive power. One-hot encoding would create too many sparse columns, and label encoding would impose an arbitrary ordinal relationship.

Answer analysis

Option-by-option breakdown

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

  • Drop the neighborhood feature entirely

    Why it's wrong here

    Dropping the feature discards potentially valuable information unnecessarily.

  • Apply frequency encoding, replacing each neighborhood with its count in the training set

    Why it's wrong here

    Frequency encoding may lose predictive signal and does not directly relate to the target variable.

  • One-hot encode the feature and use L1 regularization

    Why it's wrong here

    One-hot encoding 500 categories would create 500 dummy variables, causing sparsity and memory issues; L1 regularization may help but is not the most appropriate primary approach.

  • Use target encoding with proper cross-validation to avoid data leakage

    Why this is correct

    Target encoding effectively captures the relationship between categories and target, and cross-validation prevents overfitting.

About these practice questions

One of 835 original MLA-C01 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 →

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.