-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
114 lines (114 loc) · 5.49 KB
/
.Rhistory
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
library(dplyr)
tibble(Model="LR")
tibble(Model=c("LR","NB","MLP"))
tibble(Model=c("LR","NB","MLP"), Accuracy=c(0.6730, 0.6162, 0.6477))
tibble(Model=c("LR","NB","MLP"),
Accuracy=c(0.6730, 0.6162, 0.6477),
F1=c(0.6652, 0.6237, 0.6437),
Kappa=c(0.3679, 0.2906, 0.3259),
ROC=c(0.7768, 0.7223, 0.7336)
))
tibble(Model=c("LR","NB","MLP"),
Accuracy=c(0.6730, 0.6162, 0.6477),
F1=c(0.6652, 0.6237, 0.6437),
Kappa=c(0.3679, 0.2906, 0.3259),
ROC=c(0.7768, 0.7223, 0.7336))
df <- tibble(Model=c("LR","NB","MLP"),
Accuracy=c(0.6730, 0.6162, 0.6477),
F1=c(0.6652, 0.6237, 0.6437),
Kappa=c(0.3679, 0.2906, 0.3259),
ROC=c(0.7768, 0.7223, 0.7336))
tidyr::gather(df, Model, Performance, Accuracy:ROC, factor_key=TRUE)
df_long <- tidyr::gather(df, Model, Performance, Accuracy:ROC, factor_key=TRUE)
df_long <- tidyr::gather(df, Metric, Performance, Accuracy:ROC, factor_key=TRUE)
df_long
library(ggplot2)
ggplot(df_long, aes=c(x=Model,y=Performance, fill=Metric)) +
geom_bar(stat="identity")
ggplot(df_long, aes=(x=Model,y=Performance, fill=Metric)) +
geom_bar(stat="identity")
ggplot(df_long, aes(x=Model,y=Performance, fill=Metric)) +
geom_bar(stat="identity")
ggplot(df_long, aes(x=Model,y=Performance, fill=Metric)) +
geom_bar(stat="identity", position=position_dodge())
ggplot(df_long, aes(x=Model,y=Performance, fill=Metric)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_brewer(palette="Dark2")
ggplot(df_long, aes(x=Model,y=Performance, fill=Metric)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_brewer(palette="Dark2") + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_brewer(palette="Dark2") + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_brewer(palette="Paired") + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_brewer(palette="Accent") + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_brewer(palette="Dark2") + coord_flip()
cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_brewer(palette=cbbPalette) + coord_flip()
cbbPalette
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_manual(palette=cbbPalette) + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_manual(values=cbbPalette) + coord_flip()
cbbPalette[0:3]
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_manual(values=cbbPalette[5:7]) + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_manual(values=cbbPalette[6:8]) + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric")
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric") +
scale_fill_manual(values=cbbPalette[6:8]) + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric") +
scale_fill_manual(values=cbbPalette[6:7]) + coord_flip()
cbbPalette[5]
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric") +
scale_fill_manual(values=c(cbbPalette[6:7], cbbPalette[4])) + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric") +
scale_fill_manual(values=c(cbbPalette[5:6], cbbPalette[4])) + coord_flip()
ggplot(df_long, aes(x=Metric,y=Performance, fill=Model)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric") +
scale_fill_manual(values=c(cbbPalette[7:8], cbbPalette[4])) + coord_flip()
setwd("~/University/KuLeuven/Semester2/AA/assignment3/AAForB_Assignment3/notebooks")
setwd("~/University/KuLeuven/Semester2/AA/assignment3/AAForB_Assignment3")
ggsave("output/figures/performanceS_validation.png")
ggsave("output/figures/performanceS_validation.png", units = "cm", height = 4, width = 8)
ggsave("output/figures/performanceS_validation.png", units = "cm", height = 4, width = 10)
ggsave("output/figures/performanceS_validation.png", units = "cm", height = 4, width = 14)
ggplot(df_long, aes(x=Metric,y=Performance, fill=Dataset)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric") +
scale_fill_manual(values=c(cbbPalette[7:8], cbbPalette[4])) + coord_flip()
df_long <- tidyr::gather(df, Metric, Performance, Accuracy:ROC, factor_key=TRUE)
df <- tibble(Dataset=c("Test","LIve"),
Accuracy=c(0.6730, 0.6162),
F1=c(0.6652, 0.6237),
Kappa=c(0.3679, 0.2906),
ROC=c(0.7768, 0.7223))
df_long <- tidyr::gather(df, Metric, Performance, Accuracy:ROC, factor_key=TRUE)
ggplot(df_long, aes(x=Metric,y=Performance, fill=Dataset)) +
geom_bar(stat="identity", position=position_dodge()) +
labs(x="Summary Metric") +
scale_fill_manual(values=c(cbbPalette[7:8], cbbPalette[4])) + coord_flip()