Native categorical support lets certain tree models process categorical features directly instead of converting them into numeric values. LightGBM and the H2O.ai version of XGBoost provide this capability. section 6.1.3
During handling, the algorithm sorts categories by their associated target variance. It can then treat the ordered feature like a continuous numerical attribute, avoiding some of the extra tree depth required by one-hot encoding. section 6.1.3
Compare the main trade-offs:
- One-hot encoding may require deeper decision trees to reach an equivalent split. section 6.1.3
- Ordinal encoding is simpler and can work well for decision trees, but native handling avoids treating category codes as the original representation. section 6.1.3
- Native handling is expected to be slightly slower because category sorting is required. section 6.1.3
