Skip to content

Commit df3fc09

Browse files
author
Kieran Elmes
committed
adcal/vsglint plot improvements
1 parent 5e5d99b commit df3fc09

File tree

1 file changed

+35
-19
lines changed

1 file changed

+35
-19
lines changed

plot_lasso_stats.R

+35-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/Rscript
22
library(ggplot2)
33
library(dplyr)
4+
library(Cairo)
45

56
gdat = readRDS('PrecRecF1/dat_precrecf1_glinternet') %>%
67
filter(test == "yes") %>%
@@ -20,32 +21,47 @@ ldat_large_adcaltrue = readRDS('PrecRecF1/dat_precrecf1_lasso') %>%
2021
ldat_large_limit_nb = readRDS('PrecRecF1/dat_precrecf1_lasso') %>%
2122
filter(n==10000) %>% filter(adcal==FALSE) %>% filter(nbeta_limit == 2000) %>% filter(test=="yes") %>%
2223
mutate(time_taken = time_taken + ols_time) %>%
23-
mutate(function_used="Limited beta lasso")
24+
mutate(function_used="Limited-\U03B2 lasso")
2425

2526
vsglint_dat= bind_rows(ldat_large_limit_nb, gdat)
2627
adcal_dat = bind_rows(ldat_small_adcalfalse, ldat_small_adcaltrue)
2728
large_adcal_limit_nb_dat = bind_rows(ldat_large_adcaltrue, ldat_large_limit_nb)
2829

29-
vsglint_precision_plot = ggplot(vsglint_dat, aes(x=function_used, y=precision)) + geom_boxplot() + theme_bw()
30-
vsglint_recall_plot = ggplot(vsglint_dat, aes(x=function_used, y=recall)) + geom_boxplot() + theme_bw()
31-
vsglint_time_taken_plot = ggplot(vsglint_dat, aes(x=function_used, y=time_taken)) + scale_y_continuous(trans='log10') + geom_boxplot() + theme_bw()
30+
vsglint_precision_plot = ggplot(vsglint_dat, aes(x=function_used, y=precision)) + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Precision")
31+
vsglint_recall_plot = ggplot(vsglint_dat, aes(x=function_used, y=recall)) + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Recall")
3232

33-
ggsave(vsglint_precision_plot, file="plots/vsglint_precision_plot.pdf", width=2.5, height=3)
34-
ggsave(vsglint_recall_plot, file="plots/vsglint_recall_plot.pdf", width=2.5, height=3)
35-
ggsave(vsglint_time_taken_plot, file="plots/vsglint_time_plot.pdf", width=2.5, height=3)
3633

37-
adcal_precision_plot = ggplot(adcal_dat, aes(x=function_used, y=precision)) + geom_boxplot() + theme_bw()
38-
adcal_recall_plot = ggplot(adcal_dat, aes(x=function_used, y=recall)) + geom_boxplot() + theme_bw()
39-
adcal_time_taken_plot = ggplot(adcal_dat, aes(x=function_used, y=time_taken)) + scale_y_continuous(trans='log10') + geom_boxplot() + theme_bw()
34+
vsglint_time_taken_plot = ggplot(vsglint_dat, aes(x=function_used, y=time_taken)) + scale_y_continuous(trans='log10') + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Time Taken (s)")
4035

41-
ggsave(adcal_precision_plot, file="plots/small_adcal_precision_plot.pdf", width=3, height=4)
42-
ggsave(adcal_recall_plot, file="plots/small_adcal_recall_plot.pdf", width=3, height=4)
43-
ggsave(adcal_time_taken_plot, file="plots/small_adcal_time_plot.pdf", width=3, height=4)
4436

45-
large_adcal_limit_nb_precision_plot = ggplot(large_adcal_limit_nb_dat, aes(x=function_used, y=precision)) + geom_boxplot() + theme_bw()
46-
large_adcal_limit_nb_recall_plot = ggplot(large_adcal_limit_nb_dat, aes(x=function_used, y=recall)) + geom_boxplot() + theme_bw()
47-
large_adcal_limit_nb_time_taken_plot = ggplot(large_adcal_limit_nb_dat, aes(x=function_used, y=time_taken)) + scale_y_continuous(trans='log10') + geom_boxplot() + theme_bw()
4837

49-
ggsave(large_adcal_limit_nb_precision_plot, file="plots/large_adcal_limit_nb_precision_plot.pdf", width=3, height=4)
50-
ggsave(large_adcal_limit_nb_recall_plot, file="plots/large_adcal_limit_nb_recall_plot.pdf", width=3, height=4)
51-
ggsave(large_adcal_limit_nb_time_taken_plot, file="plots/large_adcal_limit_nb_time_plot.pdf", width=3, height=4)
38+
ggsave(vsglint_precision_plot, file="plots/vsglint_precision_plot.pdf", width=2.6, height=3, device=cairo_pdf)
39+
ggsave(vsglint_recall_plot, file="plots/vsglint_recall_plot.pdf", width=2.6, height=3, device=cairo_pdf)
40+
ggsave(vsglint_time_taken_plot, file="plots/vsglint_time_plot.pdf", width=2.6, height=3, device=cairo_pdf)
41+
42+
adcal_precision_plot = ggplot(adcal_dat, aes(x=function_used, y=precision)) + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Precision")
43+
44+
45+
adcal_recall_plot = ggplot(adcal_dat, aes(x=function_used, y=recall)) + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Recall")
46+
47+
48+
adcal_time_taken_plot = ggplot(adcal_dat, aes(x=function_used, y=time_taken)) + scale_y_continuous(trans='log10') + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Time Taken (s)")
49+
50+
51+
ggsave(adcal_precision_plot, file="plots/small_adcal_precision_plot.pdf", width=2.6, height=3, device=cairo_pdf)
52+
ggsave(adcal_recall_plot, file="plots/small_adcal_recall_plot.pdf", width=2.6, height=3, device=cairo_pdf)
53+
ggsave(adcal_time_taken_plot, file="plots/small_adcal_time_plot.pdf", width=2.6, height=3, device=cairo_pdf)
54+
55+
large_adcal_limit_nb_precision_plot = ggplot(large_adcal_limit_nb_dat, aes(x=function_used, y=precision)) + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Precision")
56+
57+
58+
large_adcal_limit_nb_recall_plot = ggplot(large_adcal_limit_nb_dat, aes(x=function_used, y=recall)) + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Recall")
59+
60+
61+
large_adcal_limit_nb_time_taken_plot = ggplot(large_adcal_limit_nb_dat, aes(x=function_used, y=time_taken)) + scale_y_continuous(trans='log10') + geom_boxplot() + theme_bw() + theme(axis.title.x = element_blank()) + labs(y = "Time Taken (s)")
62+
63+
64+
65+
ggsave(large_adcal_limit_nb_precision_plot, file="plots/large_adcal_limit_nb_precision_plot.pdf", width=2.6, height=3, device=cairo_pdf)
66+
ggsave(large_adcal_limit_nb_recall_plot, file="plots/large_adcal_limit_nb_recall_plot.pdf", width=2.6, height=3, device=cairo_pdf)
67+
ggsave(large_adcal_limit_nb_time_taken_plot, file="plots/large_adcal_limit_nb_time_plot.pdf", width=2.6, height=3, device=cairo_pdf)

0 commit comments

Comments
 (0)