liveBook · Manning

Native categorical support

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

Native categorical support is a model capability for processing categorical features directly without first converting them to numeric codes.

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

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Explains target-variance sorting and continuous treatment, but stops short of implementation details.
Examples
Compares one-hot and ordinal encodings with native handling through their tree-splitting behavior and speed trade-offs.
What it assumes
Assumes familiarity with categorical features and compares native handling with one-hot and ordinal encoding.
What you can do after
Apply it via LightGBM or H2O.ai XGBoost when direct categorical processing suits the model workflow.
How it connects
Connects categorical features with one-hot encoding, ordinal encoding, decision trees, and target encoding.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.