Scaling Machine Learning to High Cardinality Categorical Data

This direction is split into other directions: high-cardinality categorical encoding. Its last version stays readable and citable here.

Version 1 of 1193 papers208 conceptsfrozen 2026-10-04

In tabular machine learning, categorical features are often the most informative yet the most difficult to process. When a feature has only a few levels—like "Red," "Green," or "Blue"—standard techniques like one-hot encoding work well. However, real-world datasets frequently contain "high-cardinality" features: variables with hundreds, thousands, or even millions of unique levels, such as zip codes, product IDs, or user handles.

The research direction across these 159 papers focuses on moving beyond naive encoding to handle the dimensionality explosion and statistical sparsity that high-cardinality data creates.

The Failure of One-Hot Encoding

The most common way to handle categories is one-hot encoding, which creates a new binary column for every unique value. As noted by Xingchen Wan and colleagues in their work on CASMOPOLITAN, this approach exacerbates the "curse of dimensionality."

When cardinality is high, the feature space becomes massive and incredibly sparse. This creates several technical bottlenecks:

  • Search Space Inflation: In optimization tasks, Jiang Zhang and others found that one-hot encoding makes the search space for SMT solvers and decision tree builders computationally prohibitive (FairRepair, Branches).
  • The Zero-Gradient Problem: Paul Peseux identifies a "zero gradient" issue in neural networks where sparse, one-hot features fail to provide meaningful updates during training (Stochastic gradient descent with gradient estimator for categorical features).
  • Geometric Blindness: One-hot encoding treats all categories as equidistant. As Xuhui Fan argues, this ignores inherent correlations between categories, such as two zip codes being geographically adjacent (Categorical Projected Metric Learning).

Target Encoding and Ordered Statistics

One powerful alternative is Target Encoding, where a categorical value is replaced by the average target value for that category. However, simple target encoding is prone to massive overfitting—the model might simply "memorize" the target for rare categories.

To solve this, Andrey Gulin and the CatBoost team introduced Ordered Target Statistics. By processing data in a random permutation and only using "past" observations to calculate the mean for the "current" row, they prevent data leakage.

Similarly, Florian Pargent and Bernd Bischl have demonstrated that regularized target encoding—specifically using Generalized Linear Mixed Models (GLMM)—consistently outperforms traditional methods by providing a statistically sound way to "shrink" the estimates of rare categories toward the global mean (Regularized target encoding outperforms traditional methods).

Bridging Deep Learning and Mixed Effects

A recurring theme in recent work is the integration of classical statistics into deep learning architectures. High-cardinality features often represent "clusters" (e.g., many patients within the same hospital). Standard neural networks assume all data points are independent, which fails to capture these group-level correlations.

Saharon Rosset and Giora Simchoni proposed LMMNN, which embeds Linear Mixed Models directly into deep neural networks (Integrating Random Effects in Deep Neural Networks). This allows the model to learn "random effects" for each category level. More recently, Andrej Tschalzev and colleagues extended this with MC-GMENN, using Monte Carlo methods to make these mixed-effects networks scalable to even larger, more complex datasets (Enabling Mixed Effects Neural Networks for Diverse, Clustered Data).

Latent Embeddings and Semantic Relationships

For generative models and query engines, the challenge is representing categories in a way that captures their "meaning."

  • Learned Embeddings: In DBEst++, Qingzhi Ma uses word-embedding-style techniques to represent high-cardinality attributes, allowing a neural query engine to understand latent relationships between categories without a prohibitive memory footprint.
  • Diffusion and GANs: Generative models like CDTD by Markus Mueller and FCT-GAN by Robert Birke move away from spatial one-hot representations toward continuous-time Gaussian diffusion or Fourier transforms. These methods allow the models to synthesize high-cardinality data while remaining computationally efficient and capturing global correlations.

Why This Works: Building Intuition

The shift in this research area is from representation by expansion (one-hot) to representation by information.

One-hot encoding fails because it treats every category as a new, independent dimension, which is computationally expensive and statistically weak. The newer methods succeed by:

  1. Compressing Information: Target encoding and embeddings collapse a high-dimensional discrete space into a low-dimensional continuous space.
  2. Leveraging Hierarchy: Mixed-effects models recognize that categories aren't just labels; they are groups that share statistical properties.
  3. Discovering Order: Methods like Order and Cluster Learning (OCL) (Order Is All You Need for Categorical Data Clustering) suggest that even if categories have no natural order, an "implicit optimal order" can be discovered to map them into a mathematically friendly numerical space.

By treating high cardinality as a statistical structure to be modeled rather than a formatting hurdle to be encoded, these researchers are enabling machine learning to handle the true complexity of tabular data.

Papers in this version

Showing 60 of 193 papers.

History & citationVersion 1 · 2026-10-04

Split into other directions · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_scaling_machine_learning_to_high_cardina_05e6f93f,
  title = {Scaling Machine Learning to High Cardinality Categorical Data},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/scaling-machine-learning-to-high-cardinality-categorical-data/rdr_05e6f93f254645d6bb1ef30227752414},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-12-05},
}

This exact version (version 1, frozen text):

@misc{lacuna_scaling_machine_learning_to_high_cardina_05e6f93f_v1,
  title = {Scaling Machine Learning to High Cardinality Categorical Data},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/scaling-machine-learning-to-high-cardinality-categorical-data/rdr_05e6f93f254645d6bb1ef30227752414/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-12-05},
}