What are the trade-offs of discretizing a continuous feature into bins?

Quick Overview

Asks for the trade-offs of turning a continuous feature into bins. It tests what binning gives linear models, what it costs in lost information and edge effects, how bin edges are chosen without leakage, and when trees or splines make binning unnecessary.

What are the trade-offs of discretizing a continuous feature into bins?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

You have a continuous feature such as age or income and are considering replacing it with a set of bins. What are the trade-offs of discretizing a continuous feature into bins? ```hint Two kinds of model Compare what a linear model can express with the raw number against what it can express with one-hot bins, then ask whether a tree model gains the same thing. ``` ```hint Look at the edges Think about two values that sit just on either side of a bin edge, and two values at opposite ends of the same bin. ``` ### What a Strong Answer Covers - What binning lets a simple model express or tolerate that the raw feature does not. - What information binning discards and what the bin edges do to predictions. - How bin edges are chosen, and the leakage risk when the target is used to choose them. - When binning adds little, and the smoother alternatives. ### Follow-up Questions - How would you choose the number of bins, and how would you validate that choice? - Why does binning rarely help a gradient-boosted tree model? - In a credit scorecard, why might a team prefer bins over splines? - How should the bins handle a value at prediction time that falls outside the training range?

Overview: Asks for the trade-offs of turning a continuous feature into bins. It tests what binning gives linear models, what it costs in lost information and edge effects, how bin edges are chosen without leakage, and when trees or splines make binning unnecessary.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

You have a continuous feature such as age or income and are considering replacing it with a set of bins. What are the trade-offs of discretizing a continuous feature into bins?

What a Strong Answer Covers Guidance

  • What binning lets a simple model express or tolerate that the raw feature does not.
  • What information binning discards and what the bin edges do to predictions.
  • How bin edges are chosen, and the leakage risk when the target is used to choose them.
  • When binning adds little, and the smoother alternatives.

Follow-up Questions Guidance

  • How would you choose the number of bins, and how would you validate that choice?
  • Why does binning rarely help a gradient-boosted tree model?
  • In a credit scorecard, why might a team prefer bins over splines?
  • How should the bins handle a value at prediction time that falls outside the training range?