Last active
July 4, 2019 14:34
-
-
Save yumaueno/f88f9eb3b1c8030f9d20c3e032dc74c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data<-iris | |
data_train<-data[,-5]#5列目はラベルなので削除 | |
km<-kmeans(data_train,3) | |
km$cluster | |
table(data[,5],km$cluster)#本物のラベルとグループ分けを比較 | |
# ----xmeans------ | |
xm<-xmeans(data_train,3) | |
table(data[,5],xm$cluster)#本物のラベルとグループ分けを比較 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment