arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1907.01860cs.LGstat.ML
收藏

编码高基数字符串分类变量

Encoding high-cardinality string categorical variables

Inria(法国国家信息与自动化研究所)

Patricio Cerda, Gaël Varoquaux

摘要:

统计模型通常需要分类变量的向量表示,例如使用one-hot编码。当类别数量增加时,这种策略就会失效,因为它会创建高维特征向量。此外,对于字符串条目,独热编码不能在它们的表示中捕获信息。在这里,我们寻求高基数字符串分类变量的低维编码。理想情况下,这些应该是:可扩展到许多类别;可解释的最终用户;并促进统计分析。我们介绍了两种编码方法的字符串类别:伽玛泊松矩阵因式分解的子串计数,和最小哈希编码器,字符串相似性的快速近似。我们证明了min-hash将集合包含转化为更容易学习的不等式关系。这两种方法都是可扩展和可流化的。在真实数据和模拟数据上的实验表明,这些方法改善了具有高基数分类变量的监督学习。我们建议如下:如果可扩展性是中心,最小散列编码器是最佳选择,因为它不需要任何数据拟合;如果可解释性很重要,Gamma-Poisson因子分解是最佳选择,因为它可以被解释为对具有信息特征名称的推断类别进行独热编码。这两个模型都在原始字符串条目上启用了autoML,因为它们消除了对特征工程或数据清理的需求。

英文摘要:

Statistical models usually require vector representations of categorical variables, using for instance one-hot encoding. This strategy breaks down when the number of categories grows, as it creates high-dimensional feature vectors. Additionally, for string entries, one-hot encoding does not capture information in their representation.Here, we seek low-dimensional encoding of high-cardinality string categorical variables. Ideally, these should be: scalable to many categories; interpretable to end users; and facilitate statistical analysis. We introduce two encoding approaches for string categories: a Gamma-Poisson matrix factorization on substring counts, and the min-hash encoder, for fast approximation of string similarities. We show that min-hash turns set inclusions into inequality relations that are easier to learn. Both approaches are scalable and streamable. Experiments on real and simulated data show that these methods improve supervised learning with high-cardinality categorical variables. We recommend the following: if scalability is central, the min-hash encoder is the best option as it does not require any data fit; if interpretability is important, the Gamma-Poisson factorization is the best alternative, as it can be interpreted as one-hot encoding on inferred categories with informative feature names. Both models enable autoML on the original string entries as they remove the need for feature engineering or data cleaning.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑