1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
require(cluster)
require(class)
require(stats)
options(max.print=1000000)
dat<-read.table("https://archive.ics.uci.edu/ml/machine-learning-databases/ionosphere/ionosphere.data",sep=",")
names(dat) <- c('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35')
head(dat)
dat[order(dat[,"35"],decreasing=FALSE),]
a <- kmeans(dat[,c(1:34)], 2)
table(a$cluster,dat[,35]) |
Partager