diff --git a/epsilonValues.R b/epsilonValues.R index ed356c1..78c33ee 100644 --- a/epsilonValues.R +++ b/epsilonValues.R @@ -1,8 +1,11 @@ # Libraries library(ggplot2) library(matrixStats) +library(MASS) +library(reshape2) +library(reshape) # file.choose() -convergence <- read.csv(file.choose(), header=FALSE, row.names=1) +convergence <- read.csv(file.choose(), header=FALSE, row.names=1, skip=1) sds <- rowSds(sapply(convergence[,-1], `length<-`, max(lengths(convergence[,-1]))), na.rm=TRUE) men <- rowMeans(sapply(convergence[,-1], `length<-`, max(lengths(convergence[,-1]))), na.rm=TRUE) @@ -14,13 +17,19 @@ data <- data.frame( means=men, sds=sds ) +print(length(men)) +convergence$group <- row.names(convergence) +convergence.m <- melt(convergence, id.vars = "group") + +ggplot(data, aes(x=men, y=sds)) + + geom_boxplot() ggplot(data) + - geom_bar(aes(x=names, y=means), stat="identity", fill="skyblue", alpha=0.7) + - geom_errorbar( aes(x=names, ymin=means-sds, ymax=means+sds), width=0.4, colour="orange", alpha=0.9, size=1.3) + - geom_text(aes(label=as.integer(means), x =names, y=means), position=position_dodge(width=0.9), vjust=-0.25) + - xlab("Epsilon") + ylab("avg. amount of episodes until convergence") + geom_bar(aes(x=names, y=means, fill=means), stat="identity", color="black", alpha=0.8) + + geom_errorbar( aes(x=names, ymin=means, ymax=means+sds), width=0.4, colour="black", alpha=0.8, size=0.6) + + #geom_text(aes(label=as.integer(means), x =names, y=means), position=position_dodge(width=0.9), vjust=-0.25) + + xlab("Epsilon") + ylab("avg. amount of episodes until convergence") -ba <- barplot(names=rownames(convergence), height=men, ylim=c(0, max(men)*1.2), ylab = "avg. episodes until convergence", xlab = "epsilon value") -text(x = ba, y = men, label = as.integer(men), pos = 3, cex = 0.8, col = "red") +#ba <- barplot(names=rownames(convergence), height=men, ylim=c(0, max(men)*1.2), ylab = "avg. episodes until convergence", xlab = "epsilon value") +#text(x = ba, y = men, label = as.integer(men), pos = 3, cex = 0.8, col = "red") diff --git a/src/main/java/example/DinoSampling.java b/src/main/java/example/DinoSampling.java index 12fcdbc..576aad2 100644 --- a/src/main/java/example/DinoSampling.java +++ b/src/main/java/example/DinoSampling.java @@ -16,7 +16,7 @@ import java.nio.file.StandardOpenOption; public class DinoSampling { public static final float f =0.05f; - public static final String FILE_NAME = "converge.txt"; + public static final String FILE_NAME = "convergenceAdvancedMCnegRew.txt"; public static void main(String[] args) { File file = new File(FILE_NAME); try {