バックミラーアルゴリズムをRで実行したいのですが、hac(階層的クラスタリング)とk-meansクラスタリングを組み合わせたものです。 そう、私はk平均の多くの中心を選択したいと思います。 たとえば、クラスタの1つに3つのシードがあります。 これは、自分のコードであるk-meansクラスタリングの多くの初期中心を選択するにはR
虹彩データのデータはここ
irists <- read.csv("irists.csv", header = TRUE)
str(irists)
irists.m <- as.matrix(irists[,1:4])
dm <- dist(irists.m, method = "euclidean")
hc <- hclust(dm, method = "complete")
plot(hc)
clusterCut <- cutree(hc,3)
clusterCut
i1 <- iristr.m[c(1,4,12),] # one of cluster have many seed(center)
i1
i2 <- iristr.m[c(2,5,8),] # one of cluster have many seed(center)
i2
i3 <- iristr.m[c(3,6,7,9,10,11),] # one of cluster have many seed(center)
i3
buckshot <- kmeans(iristr.m, centers=i1,i2,i3) # realized only "i1" centers
buckshot
table(buckshot$cluster,iristr$Species)
、すべてが完全に投機的です。 [再現可能な例について](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)を読んでから、何かを使って質問を編集してください。 – r2evans