When is discretization (binning) a useful feature transformation?
mediumAnswer
- Binning turns a continuous feature into categorical buckets — great when (1) the relationship with y is highly non-linear and non-monotonic, so a linear model can't capture it; (2) you want to expose interactions between binned features cleanly; (3) domain knowledge suggests thresholds (age < 18, 18-65, > 65).
- Trees don't benefit — they discretize on their own.
- Choose bins by equal-width, equal-frequency, or supervised (decision-tree-based binning that maximizes mutual information with y).
Check yourself — multiple choice
- Binning always hurts model quality
- Useful for linear models with non-monotonic relationships; unnecessary for trees
- Only for categorical features
- Binning is a form of one-hot encoding
Binning: helps linear models with non-monotonic relationships; trees don't need it.
#feature-engineering#features
Practise Supervised Learning
215 interview questions in this topic.
Related questions
- When should you add interaction features to a linear model?
- Ordinal vs nominal encoding — how do you choose?
- What is target encoding and when is it useful?
- How do you encode cyclical features like hour-of-day or day-of-week?
- How do you turn text into features for a classical model?
- You have a feature with 50,000 unique category values. How do you encode it?