Hierarchical Cluster using dissimilarity matrix R
我具有包含数值和分类属性的混合数据类型矩阵Data_string大小(947 x 41)。
我使用daisy()函数和Rstudio中的Gower距离度量来生成距离矩阵(947 x 947)。
1 | d <- daisy(Data_String, metric ="gower", stand = FALSE,type = list(symm = c("V1","V13") , asymm = c("V8","V9","V10"))) |
我使用不相似矩阵(d)应用了层次聚类。
1 2 3 4 5 6 7 8 9 10 11 12 | # hclust hc <- hclust(d, method="complete") plot(hc) rect.hclust(hc, 4) cut <- cutree(hc, k = 1:5) View(cut) #Diana d_as <- as.matrix(d) DianaCluster <- diana(d_as, diss = TRUE, keep.diss = TRUE) print(DianaCluster) plot(DianaCluster) |
以下是我的情节。
**注意:由于我没有足够的声望点,因此我无法在此处上传图片。
我正在努力了解结果,任何人都可以请
1-建议我可以在R中应用的任何解决方案,以简化对结果的理解。
或
2-我如何将其链接到我的源数据,因为所有结果均基于相异矩阵。
请看一下-
https://stats.stackexchange.com/questions/130974/how-to-use-both-binary-and-continuous-variables-together-in-clustering
它说明了如何将高卢相似矩阵与hclust一起使用。希望这会有所帮助!