【发布时间】:2020-04-24 03:09:42
【问题描述】:
我想对我的数据集的特定列进行 K-means。 由于这些是分类数据,我计划对其进行 onehot_encoding。现在我想知道是否可以对特定列进行 K-means 并显示所有列的结果(例如一组)?
例如,我有col1, col2 and col3,col2 and col3 上的 K-means 是 onehot_encoded,并以col1, col2 and col3 显示结果。
我希望我已经明确表达了我的担忧
【问题讨论】:
-
您可以只删除不是用于聚类的单热编码的列,然后使用原始数组/数据帧/....上的标签。无论如何,它肯定会成功如果您发布到目前为止的代码的 sn-p,则更容易为您提供帮助(并且响应更具体)。
-
好的,谢谢,如果有问题我会写代码贴出来
标签: python machine-learning scikit-learn k-means