File:Ruspini.png: Difference between revisions
Appearance
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) |
|||
| Line 1: | Line 1: | ||
== Summary == | == Summary == | ||
<syntaxhighlight lang="rsplus"> | |||
library(cluster) | library(cluster) | ||
# ruspini is 75 x 2 | # ruspini is 75 x 2 | ||
| Line 18: | Line 19: | ||
} | } | ||
par(op) | par(op) | ||
</syntaxhighlight> | |||
Latest revision as of 09:41, 10 August 2022
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/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 09:21, 10 August 2022 | 1,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) |
You cannot overwrite this file.
File usage
The following page uses this file: