Similarity encoding for learning with dirty categorical variables - Archive ouverte HAL Access content directly
Journal Articles Machine Learning Year : 2018

Similarity encoding for learning with dirty categorical variables

(1) , (1) , (2, 3)
1
2
3

Abstract

For statistical learning, categorical variables in a table are usually considered as discrete entities and encoded separately to feature vectors, e.g., with one-hot encoding. "Dirty" non-curated data gives rise to categorical variables with a very high cardinality but redundancy: several categories reflect the same entity. In databases, this issue is typically solved with a deduplication step. We show that a simple approach that exposes the redundancy to the learning algorithm brings significant gains. We study a generalization of one-hot encoding, similarity encoding, that builds feature vectors from similarities across categories. We perform a thorough empirical validation on non-curated tables, a problem seldom studied in machine learning. Results on seven real-world datasets show that similarity encoding brings significant gains in prediction in comparison with known encoding methods for categories or strings, notably one-hot encoding and bag of character n-grams. We draw practical recommendations for encoding dirty categories: 3-gram similarity appears to be a good choice to capture morphological resemblance. For very high-cardinality, dimensionality reduction significantly reduces the computational cost with little loss in performance: random projections or choosing a subset of prototype categories still outperforms classic encoding approaches.
Fichier principal
Vignette du fichier
article_hal.pdf (1.55 Mo) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-01806175 , version 1 (01-06-2018)

Identifiers

Cite

Patricio Cerda, Gaël Varoquaux, Balázs Kégl. Similarity encoding for learning with dirty categorical variables. Machine Learning, 2018, ⟨10.1007/s10994-018-5724-2⟩. ⟨hal-01806175⟩
4920 View
4572 Download

Altmetric

Share

Gmail Facebook Twitter LinkedIn More