2015-09-17 35 views
0

我有混合數據類型矩陣Data_string大小(947 x 41)包含數字和分類屬性。使用差異矩陣的分層聚類R

我用Rstudio中的daisy()函數和Gower距離度量生成了一個距離矩陣(947 x 947)。

d <- daisy(Data_String, metric = "gower", stand = FALSE,type = list(symm = c("V1","V13") , asymm = c("V8","V9","V10"))) 

我應用了使用不相似矩陣(d)的層次聚類。

# 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) 

以下是我的情節。

Diana_plot

hclust_plot

**注:我不能在這裏上傳的圖片,因爲我沒有足夠的聲譽的點。

我努力理解的結果,任何人都可以請

1-認爲我在R中可以適用於簡化我的結果的理解任何解決方案。

2-如何我可以,因爲所有的結果都是基於相似矩陣將其鏈接到我的源數據。

+0

閱讀關於聚類方法的書嗎?或者查看[此鏈接](http://www.stat.berkeley.edu/~s133/Cluster2a.html)或[this](http://iasri.res.in/ebook/win_school_aa/notes/cluster_analysis_usingr.pdf )讓你開始。 – ekstroem

+0

非常感謝你,我意識到情節會因理解而混亂,所以我使用「cutree」函數來獲取集羣列表而不是樹狀圖。 – user3895291

回答