SpinTheMic
Pro

Explain it in 60 seconds

Encoding high-cardinality categorical features

Machine Learning · Feature Engineering · Intermediate

How do you handle categorical features with thousands of unique values, like product IDs or zip codes?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • One-hot creates huge sparse matrices.
  • Options: target encoding, frequency encoding, hashing, embeddings.
  • Group rare values; use hierarchy (zip to region).
  • Native categorical support in CatBoost/LightGBM.
  • Choose based on model type and data size.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics