Skip to main content
QUICK REVIEW

[Paper Review] A Comparison of Machine Learning Methods for Data with High-Cardinality Categorical Variables

Fabio Sigrist|arXiv (Cornell University)|Jul 5, 2023
Forecasting Techniques and ApplicationsDecision Sciences3 citations
TL;DR

This paper compares machine learning methods for tabular data with high-cardinality categorical variables, evaluating tree-boosting, deep neural networks, and linear mixed effects models with and without random effects. It finds that models with random effects significantly improve prediction accuracy, and tree-boosting with random effects outperforms deep neural networks with random effects across multiple datasets.

ABSTRACT

High-cardinality categorical variables are variables for which the number of different levels is large relative to the sample size of a data set, or in other words, there are few data points per level. Machine learning methods can have difficulties with high-cardinality variables. In this article, we empirically compare several versions of two of the most successful machine learning methods, tree-boosting and deep neural networks, and linear mixed effects models using multiple tabular data sets with high-cardinality categorical variables. We find that, first, machine learning models with random effects have higher prediction accuracy than their classical counterparts without random effects, and, second, tree-boosting with random effects outperforms deep neural networks with random effects.

Motivation & Objective

  • To evaluate the performance of machine learning models on tabular datasets containing high-cardinality categorical variables.
  • To investigate whether incorporating random effects improves prediction accuracy for such data.
  • To compare tree-boosting, deep neural networks, and linear mixed effects models in terms of predictive performance and computational efficiency.
  • To assess the impact of different encoding strategies (e.g., one-hot, embeddings, numeric mapping) on model performance.
  • To determine whether random effects serve as an effective regularizer in high-cardinality settings.

Proposed method

  • Empirically compare multiple variants of tree-boosting (LightGBM, CatBoost, GPBoost), deep neural networks with entity embeddings, and linear mixed effects models on real-world tabular datasets.
  • Use random effects in tree-boosting and deep neural networks to model group-level variation, treating each level of a high-cardinality categorical variable as a random effect.
  • Apply mixed effects modeling where the response mean is modeled as a sum of fixed effects and random effects, with random effects drawn from a normal distribution with learned variance.
  • For deep neural networks, use a hybrid architecture combining dense layers with random effects (LMMNN) to capture group-level patterns.
  • For tree-boosting, use native support for categorical variables in LightGBM and CatBoost, and compare performance with numeric encoding and random effects.
  • Evaluate models using mean squared error (MSE) and report average relative difference to the best-performing method, along with average rank across datasets.
Figure 1: Average relative difference (in %) to the lowest test MSE. The Wages data set is not included for calculating this since not all methods were run on it.
Figure 1: Average relative difference (in %) to the lowest test MSE. The Wages data set is not included for calculating this since not all methods were run on it.

Experimental results

Research questions

  • RQ1Does incorporating random effects into machine learning models improve prediction accuracy on high-cardinality categorical variables?
  • RQ2How do tree-boosting models with random effects compare to deep neural networks with random effects in terms of predictive performance?
  • RQ3How do different encoding strategies (e.g., one-hot, embeddings, numeric mapping) affect model performance on high-cardinality categorical variables?
  • RQ4Do linear mixed effects models outperform classical independent models in this setting?
  • RQ5Is there a consistent performance advantage for tree-boosting over deep neural networks when handling high-cardinality categorical variables?

Key findings

  • Machine learning models with random effects achieve significantly higher prediction accuracy than their classical counterparts without random effects.
  • Tree-boosting with random effects outperforms deep neural networks with random effects, achieving an average relative difference to the best method of 17.3% for LMMNN and 17.4% for LightGBM (Cat) compared to 111% for LightGBM (Num) and 189% for neural networks with embeddings.
  • The best-performing method overall was GPBoost with random effects, achieving an average relative difference of 9.63% and an average rank of 2.43.
  • Linear mixed effects models performed worst, with an average relative difference of 47.7% and an average rank of 5.71.
  • CatBoost and LightGBM with native categorical support performed better than their numeric encoding counterparts, with LightGBM (Cat) achieving an average rank of 3.29.
  • Wall-clock time varied significantly, with neural networks and LMMNN running on GPU and other models on CPU, but performance differences were not directly tied to speed.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.