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 | > zooDataset <- read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/zoo/zoo.data", sep="," ) > zooDataset V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 1 aardvark 1 0 0 1 0 0 1 1 1 1 0 0 4 0 0 1 1 2 antelope 1 0 0 1 0 0 0 1 1 1 0 0 4 1 0 1 1 3 bass 0 0 1 0 0 1 1 1 1 0 0 1 0 1 0 0 4 4 bear 1 0 0 1 0 0 1 1 1 1 0 0 4 0 0 1 1 ... 99 wolf 1 0 0 1 0 0 1 1 1 1 0 0 4 1 0 1 1 100 worm 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 7 101 wren 0 1 1 0 1 0 0 0 1 1 0 0 2 1 0 0 2 > zooClasses <- factor(zooDataset$V18) > zooFeatures <- zooDataset[c(2:17)] > zooFeatures V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 1 1 0 0 1 0 0 1 1 1 1 0 0 4 0 0 1 2 1 0 0 1 0 0 0 1 1 1 0 0 4 1 0 1 3 0 0 1 0 0 1 1 1 1 0 0 1 0 1 0 0 4 1 0 0 1 0 0 1 1 1 1 0 0 4 0 0 1 ... 99 1 0 0 1 0 0 1 1 1 1 0 0 4 1 0 1 100 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 101 0 1 1 0 1 0 0 0 1 1 0 0 2 1 0 0 > zooPCA <- prcomp( scale( zooFeatures[,-1] ) ) > plot(zooPCA$x[,1:2], col=zooClasses) > |
1 2 3 4 5 6 7 | set multiplot layout 3,1 title "ART1 Clustering" set yrange [-1:9] plot 't1.dat' with linespoints title 't1' plot 't2.dat' with linespoints title 't2' plot 't3.dat' with linespoints title 't3' unset multiplot pause -1 |
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 | unset border set polar set angles degrees set style line 10 lt 1 lc 0 lw 0.3 set grid polar 17.14 set grid ls 10 set xtics axis format "" scale 0 set ytics axis format "" set size square set style line 11 lt 1 lw 2 pt 2 ps 2 set multiplot layout 3,3 plot 'cluster1.txt' using 1:2 t "" w lp ls 11 plot 'cluster2.txt' using 1:2 t "" w lp ls 11 plot 'cluster3.txt' using 1:2 t "" w lp ls 11 plot 'cluster4.txt' using 1:2 t "" w lp ls 11 plot 'cluster5.txt' using 1:2 t "" w lp ls 11 plot 'cluster6.txt' using 1:2 t "" w lp ls 11 plot 'cluster7.txt' using 1:2 t "" w lp ls 11 plot 'cluster8.txt' using 1:2 t "" w lp ls 11 plot 'cluster9.txt' using 1:2 t "" w lp ls 11 unset multiplot pause -1 |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |