Paths Subjects Questions Quizzes Pricing Search
Intermediate Open Pro

Choosing Encodings by Cardinality and Model Family

You're building a LightGBM model and, separately, a logistic regression baseline, on the same table with these categorical columns:

  • plan_tier (4 values: free, basic, pro, enterprise — ordered)
  • signup_country (60 values, roughly balanced)
  • zip_code (28,000 values, heavy-tailed — a few zips have thousands of customers, most have a handful)
  1. Propose an encoding for each column, for each model, and justify the difference between the two models where it exists.
  2. zip_code is genuinely predictive (it proxies for local market conditions). What are the two main strategies to make it usable without exploding dimensionality or leaking, and what's the trade-off between them?
  3. A teammate one-hot encodes zip_code for the LightGBM model and reports a large accuracy gain over target encoding. What would you check before believing the comparison?

Share this question

← Back to Feature Engineering practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.