-
Notifications
You must be signed in to change notification settings - Fork 3
/
figure-aum-train.R
42 lines (40 loc) · 1.02 KB
/
figure-aum-train.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
source("packages.R")
result.list <- readRDS("figure-aum-train-data.rds")
iterations.tall <- melt(result.list$iterations, id="step.number")
gg <- ggplot()+
geom_line(aes(
step.number, value),
data=iterations.tall)+
facet_grid(variable ~ ., scales="free")+
ylab("")
png("figure-aum-train-iterations.png", width=3, height=3, units="in", res=200)
print(gg)
dev.off()
result.list$auc[, `:=`(x=c(0.25), y=c(0.75, 0.5))]
gg <- ggplot()+
geom_path(aes(
FPR, TPR, color=pred.name),
data=result.list$roc)+
geom_point(aes(
FPR, TPR, color=pred.name),
fill="white",
shape=21,
data=result.list$auc)+
geom_segment(aes(
x, y,
xend=FPR, yend=TPR,
color=pred.name),
data=result.list$auc)+
geom_label(aes(
x, y, color=pred.name,
label=sprintf(
"%s errors=%d auc=%.2f",
pred.name, errors, auc)),
size=3,
hjust=0,
data=result.list$auc)+
coord_equal()+
guides(color="none")
png("figure-aum-train.png", width=3, height=3, units="in", res=200)
print(gg)
dev.off()