Do ordinal codes measure the distance between categories?

Ordinal encoding assigns integer codes per feature and allows an explicit category order.

OrdinalEncoder in practice

Codes zero, one and two can order small, medium and large cups. In a linear model they also imply equal spacing, which may not reflect actual volume.

中文

有序编码的整数距离代表什么?

OrdinalEncoder 给每列类别分配整数代码,可通过显式列表确定顺序。

OrdinalEncoder 应用实例

把小、中、大排成 0、1、2 能表达先后。在线性模型里这还隐含等间距,未必对应三种杯子的真实容量差。

References / 参考来源

Keep reading / 继续阅读