-
Notifications
You must be signed in to change notification settings - Fork 0
/
results.R
71 lines (57 loc) · 2.21 KB
/
results.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
library(data.table)
library(dplyr)
library(ggplot2)
var_names <- c("run_number",
"true_pos", "true_neg",
"false_pos", "false_neg",
"normal", "attacks",
"perc.norma","perc.attac",
"correct", "wrong",
"accuracy", "precision",
"recall", "f_measure",
"g_mean", "false_alrm",
"det_rate", "sizeof_L",
"sizeof_U", "unlab_h1",
"unlab_h2", "unlab_h3",
"tritr.iter", "auc",
"time.train", "time.pred",
"L.ratio", "U.ratio",
"T.length"
)
dt.res <- data.table(read.csv(file = "results_all.csv",
header = FALSE,
col.names = var_names))
dt.res.mean <- dt.res[, lapply(.SD, mean),
by=list(L.ratio, U.ratio, T.length)]
dt.res.median <- dt.res[, lapply(.SD, median),
by=list(L.ratio, U.ratio, T.length)]
dt.tmp <- data.frame(dt.res.mean)
dt.tmp$L.ratio <- as.factor(dt.tmp$L.ratio)
qplot(x=sizeof_L,
y=(unlab_h1+unlab_h2+unlab_h3)/3,
data=dt.tmp,
main = "Unlabeled data sample, vs Labeled set size",
ylab = "Average size of unlabeled sample",
xlab = "Size of Labeled dataset",
color=L.ratio) + geom_smooth(se=F)
qplot(x=sizeof_L,
y=precision,
data=dt.tmp,
main = "Precision, vs Labeled set size",
ylab = "Precision",
xlab = "Size of Labeled dataset",
color=L.ratio) + geom_smooth(se=F) + labs(colour="Labeled \nset ratio")
qplot(x=sizeof_L,
y=(unlab_h1+unlab_h2+unlab_h3)/3,
data=dt.tmp,
main = "Unlabeled data sample, vs Labeled set size",
ylab = "Average size of unlabeled sample",
xlab = "Size of Labeled dataset",
shape=L.ratio) + geom_smooth(se=F, aes(color=L.ratio)) + theme_bw() + scale_color_grey()
qplot(x=sizeof_L,
y=precision,
data=dt.tmp,
main = "Precision, vs Labeled set size",
ylab = "Precision",
xlab = "Size of Labeled dataset",
color=L.ratio, shape=L.ratio) + geom_smooth(se=F, aes(color=L.ratio)) +theme_bw() +scale_color_grey()