Repository for the paper A benchmark of categorical encoders for binary classification, accepted at NeurIPS 2023, Datasets and Benchmarks track.
Ranks of encoders conditional on the model (lower rank is better). Sum, One-Hot, WoE, and Binary encoders are consistently among the best for logistic regression (LogReg), while no encoder is clearly on top for decision tree (DT). Even considering all the models (LogReg, DT, kNN, SVM, and LGBM), Sum, One-Hot, WoE, and Binary encoders are the best ones.- Install Python 3.8.10;
- create and activate a virtual environment, we call it
venv
; - install dependencies with
pip install -r requirements
.
Our implementations of GLMM-based encoders require the rpy2 module and R to be installed.
The R version we used is 4.2.2
, with the lme4
package version 1.1-31
.
To aggregate results with Kemeny aggregation, install and configure Gurobi and its Python API.
All of the code necessary to reproduce the analysis and the plots is available in the analysis directory.