-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_two_level.R
43 lines (36 loc) · 1 KB
/
plot_two_level.R
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
32
33
34
35
36
37
38
39
40
41
42
43
source("tables.R")
source("plots.R")
plotdata <- table_search_best() %>%
filter(sketch_bits == 0, algorithm == "TwoLevelLSH")
plot_threshold <- function(dat, thr) {
pd <- dat %>% filter(threshold == thr)
fracs <- ggplot(
pd,
aes(
x = k2,
y = fraction_candidates,
color = factor(k)
)
) +
geom_point() +
geom_line(alpha = 0.5, size = 0.5) +
geom_hline(yintercept = 1) +
facet_wrap(vars(dataset), ncol = 4, scales = "fixed") +
theme_paper()
loads <- ggplot(
pd,
aes(
x = k2,
y = Load,
color = factor(k)
)
) +
geom_point() +
geom_line(alpha = 0.5, size = 0.5) +
facet_wrap(vars(dataset), ncol = 4, scales = "free") +
theme_paper()
fracs / loads
}
plot_threshold(plotdata, 0.5) / guide_area() +
plot_layout(guides = "collect", heights = c(3, 3, 1))
ggsave("imgs/two_level.png", width = 10, height = 5)