| plot(myakari0elv) |
| library(mclust) mykmakari17elv <- kmeans(myakari0elv, 17, nstart=50) clPairs(myakari0elv, cl=mykmakari17elv$cluster) |
主成分分析を実行する | mycmpakari0elv <- prcomp(myakari0elv, scale=TRUE) |
| clPairs(mycmpakari0elv$x, cl=mykmakari17elv$cluster) |
主成分「PC1」「PC2」「PC3」で k-meansを実行 | mykmakari17elvc3 <- kmeans(mycmpakari0elv$x, 17, nstart=50) clPairs(myakari0elv, cl=mykmakari17elvc3$cluster) |
ばーん | original <- mykmakari17elvc3$centers %*% t(mycmpakari0elv$rotation) original <- scale(original, center = FALSE, scale = 1 / mycmpakari0elv$scale) original <- scale(original, center = -mycmpakari0elv$center, scale = FALSE) myakaricenters17elvc3o <- as.table(original) write.table(myakaricenters17elvc3o, file="clipboard", sep="\t") |
すたぱーん | plot(myakari2d, type="n") text(myakaricenters17elvc3o) rect(0, 0, 256, -256, border = "red") |