torch_frame.transforms.CatToNumTransform
- class CatToNumTransform[来源]
-
使用目标统计量转换
TensorFrame中的分类特征。原始转换在分类和预测问题中高基数分类属性的预处理方案论文中进行了说明。具体来说,每个分类特征通过m-概率估计转换为数值特征,定义如下:
\[\frac{n_c + p \cdot m}{n + m}\]其中 \(n_c\) 是类别的计数,\(n\) 是总计数,\(p\) 是先验概率,\(m\) 是平滑因子。