1
我有一個由R集羣情節,而我想優化與wss情節聚類的「肘標準」,但我不知道如何繪製給定集羣的wss情節,任何人都可以幫助我?如何繪製羣集內羣集平方和的圖形?
這裏是我的數據:
Friendly<-c(0.467,0.175,0.004,0.025,0.083,0.004,0.042,0.038,0,0.008,0.008,0.05,0.096)
Polite<-c(0.117,0.55,0,0,0.054,0.017,0.017,0.017,0,0.017,0.008,0.104,0.1)
Praising<-c(0.079,0.046,0.563,0.029,0.092,0.025,0.004,0.004,0.129,0,0,0,0.029)
Joking<-c(0.125,0.017,0.054,0.383,0.108,0.054,0.013,0.008,0.092,0.013,0.05,0.017,0.067)
Sincere<-c(0.092,0.088,0.025,0.008,0.383,0.133,0.017,0.004,0,0.063,0,0,0.188)
Serious<-c(0.033,0.021,0.054,0.013,0.2,0.358,0.017,0.004,0.025,0.004,0.142,0.021,0.108)
Hostile<-c(0.029,0.004,0,0,0.013,0.033,0.371,0.363,0.075,0.038,0.025,0.004,0.046)
Rude<-c(0,0.008,0,0.008,0.017,0.075,0.325,0.313,0.004,0.092,0.063,0.008,0.088)
Blaming<-c(0.013,0,0.088,0.038,0.046,0.046,0.029,0.038,0.646,0.029,0.004,0,0.025)
Insincere<-c(0.075,0.063,0,0.013,0.096,0.017,0.021,0,0.008,0.604,0.004,0,0.1)
Commanding<-c(0,0,0,0,0,0.233,0.046,0.029,0.004,0.004,0.538,0,0.146)
Suggesting<-c(0.038,0.15,0,0,0.083,0.058,0,0,0,0.017,0.079,0.133,0.442)
Neutral<-c(0.021,0.075,0.017,0,0.033,0.042,0.017,0,0.033,0.017,0.021,0.008,0.717)
data <- data.frame(Friendly,Polite,Praising,Joking,Sincere,Serious,Hostile,Rude,Blaming,Insincere,Commanding,Suggesting,Neutral)
這裏是我的羣集的代碼:
cor <- cor (data)
dist<-dist(cor)
hclust<-hclust(dist)
plot(hclust)
並運行上面的代碼後,我會得到一個樹狀圖,而我怎麼可以得出一個陰謀像這樣:
謝謝!但爲什麼y軸上的數值非常大,而我的數據確實非常小?另外,你能回答我關於wss-plot的另一個問題嗎?:https://stackoverflow.com/questions/25977798/why-is-the-line-of-wss-plot-for-optimize-the- cluster-analysis-looks-so-volaua – 2014-09-22 15:30:00
y軸上的值由數據中變量的比例決定。我會看看另一個Q. – 2014-09-22 16:08:24