简体   繁体   English

在R中使用hclust聚类属性

[英]cluster attributes using hclust in R

I have a data set which is two dimensional data with column names as attributes and rows as items. 我有一个数据集,它是二维数据,列名称作为属性,行名称作为项。 A sample is given below: 下面是一个示例:

       A1    A2   A3   A4   ....
Item1  0     1     0    0
Item2  0     0     0    1
Item3  1    1      0    0

.... ....

I have used hclust (ward.D2 method) to create a cluster dendrogram in R. I can get the labels of all items in a cluster. 我已经使用hclust(ward.D2方法)在R中创建了群集树状图。我可以获取群集中所有项目的标签。 How do i find out the list of attributes (A1 A2 etc) of the cluster so I can infer how those items came together? 我如何找出群集的属性列表(A1 A2等),以便推断这些项目是如何组合在一起的?

The code which i have tried is : 我尝试过的代码是:

d <- vegdist(data,method="jaccard")
fit <- hclust(d,method="ward.D2")
plot(fit)
hcd <- as.dendrogram(fit)
plot(cut(hcd,h=3)$upper)
labels(cut(hcd, h=3)$lower[[1]])

Hierarchical clustering does not handle columns. 分层群集不处理列。

It operates on the distance matrix - there are no column labels anymore. 它在距离矩阵上运行 -不再有列标签。

You may be looking for biclustering instead. 您可能正在寻找双集群。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM