且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

K-Means和Categorical变量

更新时间:2023-12-02 21:56:10

k-means有一种变体,称为k-modes,适用于分类数据。

实际上,建议(将分类属性转换为二进制值,然后将k均值视为数值),这是之前尝试过的另一种方法(早于k模式)。



I have several datasets with both numeric and categorical variables and want to do K-Means clustering. I realize that K-Means works best with numeric variables but what's the best way to deal with the categorical variables?

Thanks,

John

There's a variation of k-means known as k-modes, which is suitable for categorical data.
Actually, Suggest (converting categorical attributes to binary values, and then doing k-means as if these were numeric values) is another approach that has been tried before (predating k-modes).