【发布时间】:2015-04-08 05:49:25
【问题描述】:
我正在对我的数据运行 k-means 算法,标签的输出如下所示:
[0 5 8 6 1 3 3 2 2 5 5 6 1 1 3 3 1 8 8 3 3 1 1 1 1 5 2 5 1 1 7 3 6 4 3 3 8
1 3 3 5 1 8 8 1 8 7 1 1 8 6]
这个向量包含点索引的簇号,例如第一个值是簇号。 0 表示点索引 0,向量的第二个值表示它的簇号。 5和点索引1属于它。
我想要集群的子集: 喜欢:
cluster no 0 = { its index numbers}
cluster no 1 = { its index numbers}
..
cluster no 8 = { its index numbers}
例如,向量的第一个值为 5,我需要列出该向量的所有值为 5 的索引,反之亦然。我希望每个值都有自己的索引列表。
所以价值 5 的列表应该是:
簇 5 = [ 1,9,10,25,27....
以及其他值的所有输出,最终输出应该是8个列表。
【问题讨论】:
标签: python vector cluster-analysis k-means