mybox0 <- function(fname){ tab <- read.csv(paste("output/", fname, ".comp.txt", sep=""), header=T); postscript(paste("figures/", fname, ".rbox.ps", sep="")); boxplot(tab, ylab="Relative Mean Square Error", main=fname, cex.axis=2, cex.lab=2, cex.main=2); dev.off(); } mybox1 <- function(fname){ tab <- read.csv(paste("output/", fname, ".comp.txt", sep=""), header=T); postscript(paste("figures/", fname, ".box.ps", sep="")); boxplot(tab, ylab="Error Rate", main=fname, cex.axis=2, cex.lab=2, cex.main=2); dev.off(); } mybox2 <- function(fname){ tab <- read.csv(paste("output/", fname, ".comp.txt", sep=""), header=T); tab <- 1 - tab; for (i in 1:dim(tab)[1]){ tab[i, ] <- tab[i, ] / min(tab[i, ]); } postscript(paste("figures/", fname, ".rbox.ps", sep="")); boxplot(tab, ylab="Relative Classifation Rate", main=fname, cex.axis=2, cex.lab=2, cex.main=2); dev.off(); } fnames <- c("Basketball", "BodyFat", "BostonHousing", "Friedman1", "Friedman2", "Friedman3", "Circle2", "Circle5", "Circle20", "Ionosphere", "Sonar", "WDBC"); for (fname in fnames) { print(fname); if (fname %in% fnames[1:6]){ 1;#mybox0(fname); } else { mybox2(fname); } } mybox("WDBC"); morebox <- function(fname, more=FALSE){ tab.orig <- read.csv(paste("output/", fname, ".comp.txt", sep=""), header=T); if(more == TRUE){ tab.onel <- read.table(paste("output/", fname, ".comp.onel.txt", sep=""), header=F); tab.mixl <- read.table(paste("output/", fname, ".comp.mixl.txt", sep=""), header=F); }else{ tab.onel <- matrix(NA, 1,1); tab.mixl <- matrix(NA, 1,1); } tab.secl <- read.table(paste("output/", fname, ".comp.secl.txt", sep=""), header=F); tab.all <- list(BKR.difl=tab.orig$BKR, BKR.onel=tab.onel[,1], BKR.mixl=tab.mixl[,1], BKR.secl=tab.secl[,1], BART=tab.orig$BART, SVM =tab.orig$SVM); postscript(paste("figures/", fname, ".box.more.ps", sep="")); boxplot(tab.all, ylab="Error Rate", main=fname, cex.axis=2, cex.lab=1, cex.main=2) dev.off(); return(unlist(lapply(tab.all, mean))); } a <- matrix(NA, nr=4, nc=6); fnames <- c("Circle20", "Ionosphere", "Sonar", "WDBC"); i <- 0; for(fname in fnames){ i <- i + 1; a[i, ] <- morebox(fname, TRUE); } morebox("Circle20");