A non-binary categorical feature has more than two possible classes, such as dog, cat, or bird. Decision trees handle it by asking one yes-or-no question for each class. section 9.3
To choose the best split:
- Turn each class into a binary question, such as “Is the animal a dog?” section 9.3
- Compare the resulting splits with accuracy, Gini index, or entropy. section 9.3
- Call this transformation one-hot encoding. section 9.3
Dog, cat, or bird
For an animal labeled dog, the questions “Is it a dog?”, “Is it a cat?”, and “Is it a bird?” produce yes, no, and no.
