File:Ruspini.png

From 太極
Jump to navigation Jump to search

Original file(1,000 × 550 pixels, file size: 81 KB, MIME type: image/png)

Summary

library(cluster)
# ruspini is 75 x 2
data(ruspini)
hc <- hclust(dist(ruspini), "ave"); plot(hc)

# si <- silhouette(groups, dist(ruspini))
# plot(si, main = paste("k = ", 4))

op <- par(mfrow= c(3,2), oma= c(0,0, 3, 0),
           mgp= c(1.6,.8,0), mar= .1+c(4,2,2,2))
plot(hc)
for(k in 2:6) {
  groups<- cutree(hc, k=k)
  si <- silhouette(groups, dist(ruspini))
  plot(si, main = paste("k = ", k))

}
par(op)

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current10:21, 10 August 2022Thumbnail for version as of 10:21, 10 August 20221,000 × 550 (81 KB)Brb (talk | contribs)library(cluster) # ruspini is 75 x 2 data(ruspini) hc <- hclust(dist(ruspini), "ave"); plot(hc) # si <- silhouette(groups, dist(ruspini)) # plot(si, main = paste("k = ", 4)) op <- par(mfrow= c(3,2), oma= c(0,0, 3, 0), mgp= c(1.6,.8,0), mar= .1+c(4,2,2,2)) plot(hc) for(k in 2:6) { groups<- cutree(hc, k=k) si <- silhouette(groups, dist(ruspini)) plot(si, main = paste("k = ", k)) } par(op)

The following page uses this file: