How do we handle categorical variables in decision trees?
Classic MLLevel: IntermediateDecision trees
How do we handle categorical variables in decision trees?
Hints
- How is one split selected and which objective does it improve?
- Check stopping rules, leaf size and the difference between fitting and prediction.
Answer
Some decision tree algorithms can handle categorical variables out of the box, others cannot. However, we can transform categorical variables, e.g. with a binary or a one-hot encoder.
Source and licence: Alexey Grigorev & contributors — Data Science Interviews · CC-BY-4.0