Why can one-hot bins help a linear predictor model a non-monotonic feature effect?
Classic MLLevel: IntermediatePiecewise effects
Why can one-hot bins help a linear predictor model a non-monotonic feature effect?
Hints
- Consider the basis functions seen by the model.
- Values inside one bin become indistinguishable.
Answer
Each bin receives an independent coefficient, producing a piecewise-constant effect. This loses within-bin resolution and adds parameters rather than making the raw linear relationship nonlinear by itself.
Source and licence: scikit-learn 1.7.2 — preprocessing · BSD-3-Clause · answer: Quantoros editorial