mistral-io-datasets/scripts/plot-performance.R

26 lines
1.3 KiB
R
Raw Permalink Normal View History

2020-08-21 16:21:33 +00:00
#!/usr/bin/env Rscript
library(ggplot2)
library(dplyr)
require(scales)
2020-08-25 17:00:28 +00:00
args = commandArgs(trailingOnly = TRUE)
file = "datasets/progress_4296426.csv" # for manual execution
file = args[1]
prefix = args[2]
2020-08-21 16:21:33 +00:00
2020-08-25 17:00:28 +00:00
# Plot the performance numbers of the analysis
data = read.csv(file)
2020-11-24 11:51:22 +00:00
levels(data$alg_name)[levels(data$alg_name) == "B-aggzeros"] = "B-aggz"
levels(data$alg_name)[levels(data$alg_name) == "Q-native"] = "Q-nat"
levels(data$alg_name)[levels(data$alg_name) == "Q-phases"] = "Q-phas"
2020-08-21 16:21:33 +00:00
e = data %>% filter(jobs_done >= (jobs_total - 9998))
2020-08-25 17:00:28 +00:00
e$time_per_100k = e$elapsed / (e$jobs_done / 100000)
2020-08-25 17:29:23 +00:00
ggplot(e, aes(alg_name, time_per_100k, fill=alg_name)) + geom_boxplot() + theme(legend.position=c(0.2, 0.7)) + xlab("Algorithm") + ylab("Runtime in s per 100k jobs") + stat_summary(aes(label=round(..y..,0)), position = position_nudge(x = 0, y = 200), fun=mean, geom="text", size=4) + theme(legend.title = element_blank())
ggsave(paste(prefix, "-boxplot.png", sep=""), width=4, height=4)
2020-08-25 17:00:28 +00:00
# Development when adding more jobs
ggplot(data, aes(x=jobs_done, y=elapsed, color=alg_name)) + geom_point() + ylab("Cummulative runtime in s") + xlab("Jobs processed") + theme(legend.position = "bottom") #+ scale_x_log10() + scale_y_log10()
ggsave(paste(prefix, "-cummulative.png", sep=""), width=6, height=4.5)