Skip to main content
QUICK REVIEW

[论文解读] Encoding categorical data: Is there yet anything 'hotter' than one-hot encoding?

Ekaterina Poslavskaya, А. А. Королев|arXiv (Cornell University)|Dec 28, 2023
Machine Learning and Data Classification被引用 9
一句话总结

本研究在大量 OpenML 数据集上使用线性混合效应模型评估多种编码方案,结果是在多分类任务中 one-hot 编码和 Helmert 编码优于基于目标的编码器,而在二分类任务中的差异则较小。

ABSTRACT

Categorical features are present in about 40% of real world problems, highlighting the crucial role of encoding as a preprocessing component. Some recent studies have reported benefits of the various target-based encoders over classical target-agnostic approaches. However, these claims are not supported by any statistical analysis, and are based on a single dataset or a very small and heterogeneous sample of datasets. The present study explores the encoding effects in an exhaustive sample of classification problems from OpenML repository. We fitted linear mixed-effects models to the experimental data, treating task ID as a random effect, and the encoding scheme and the various characteristics of categorical features as fixed effects. We found that in multiclass tasks, one-hot encoding and Helmert contrast coding outperform target-based encoders. In binary tasks, there were no significant differences across the encoding schemes; however, one-hot encoding demonstrated a marginally positive effect on the outcome. Importantly, we found no significant interactions between the encoding schemes and the characteristics of categorical features. This suggests that our findings are generalizable to a wide variety of problems across domains.

研究动机与目标

  • 评估编码类型在广泛、穷尽抽样的分类问题集上的预测性能影响。
  • 确定在真实世界数据集中,基于目标的编码器是否比与目标无关的编码器提供提升。
  • 评估编码选择是否影响训练/推理效率以及基于模型的特征重要性。
  • 研究编码方案与数据集特征(分类特征的存在比例、基数等)之间的交互作用。
  • 考察编码效果在二分类和多分类任务中的泛化能力。

提出的方法

  • 组装了一个穷尽的 OpenML 二分类和多分类任务数据集集合。
  • 将五种编码器(标签编码、one-hot、Helmert 编码、目标编码、Weight of Evidence(WoE) 编码)应用于所有分类特征。
  • 使用 H2O AutoML 在每个编码后的数据集上训练多种基础模型和组合堆叠集成。
  • 拟合以任务ID为随机效应、以编码类型和特征特性为固定效应的线性混合效应模型。
  • 比较线性模型和非线性模型(GLM 和 XGBoost)以及二分类与多分类任务之间的性能差异。

实验结果

研究问题

  • RQ1编码类型是否影响异质集成(堆叠集成)在二分类和多分类任务中的预测能力?
  • RQ2编码类型是否影响单个基估计器(线性与非线性)的预测能力?
  • RQ3编码方案如何在不同数据集特征下影响训练时长和效率?
  • RQ4在决定性能时,编码方案与分类特征特征之间是否存在交互作用?
  • RQ5结果是否能在 OpenML 的多样化真实世界分类问题中泛化?

主要发现

  • 在二分类任务中,分类特征的比例越高对集成性能的负面影响越大,而更高的平均基数可能会提高其性能;高基数可能降低性能。
  • 在多分类任务中,目标类别数量是性能的主要决定因素,OHE 和 Helmert 编码在堆叠集成中对基于目标的编码器显示出一些改进。
  • 对于线性模型,标签编码在二分类任务中往往降低预测能力;而在多分类任务中,基于目标/指示编码通常优于标签编码。
  • 在不同模型中,编码类型对二分类任务的集成性能影响有限或无显著影响,但在多分类的 GLM/XGBoost 结果中观察到 OHE 和 Helmert 的一些好处。
  • 在某些多分类情景下,基于目标的编码器和 OHE 相对于标签编码可以提供优势,尽管结果因模型类型而异。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。