I have a matrix x=
[[0,1,1,1,0,0,0,0],
[1,0,1,1,0,0,0,0],
[1,1,0,1,0,0,0,0],
[1,1,1,0,0,0,0,0],
[0,0,0,0,0,1,1,1],
[0,0,0,0,1,0,1,1],
[0,0,0,0,1,1,0,1],
[0,0,0,0,1,1,1,0],]
在调用AgglomerativeClustering之后,我期望数据被分成 2 个集群(0-3) 和 (4-7) 即 labels_=[0,0,0,0,1,1,1,1] 但设置了标签列表是 [0, 0, 0, 1, 0, 0, 0, 1]
我的代码如下 s=AgglomerativeClustering(affinity='precomputed',n_clusters=2,linkage='complete)
s.fit(x)
代码是否包含任何错误?为什么聚类不符合预期