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)
- Propose an encoding for each column, for each model, and justify the difference between the two models where it exists.
zip_codeis 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?- A teammate one-hot encodes
zip_codefor the LightGBM model and reports a large accuracy gain over target encoding. What would you check before believing the comparison?
Share this question