-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeat_imp_building.tex
129 lines (120 loc) · 3.8 KB
/
feat_imp_building.tex
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
\documentclass[tikz, border=1pt]{standalone}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread[col sep=comma, header=false]{
BOS, 31.0, 34.9, 34.1
BUS, 33.0, 33.8, 33.2
BIB, 32.9, 33.8, 33.3
BIT, 32.7, 33.4, 33.8
}\buildingEl
\pgfplotstablecreatecol[
create col/expr={
\thisrow{1} + \thisrow{2} + \thisrow{3}
}
]{sum}{\buildingEl}
\pgfplotstableread[col sep=comma, header=false]{
BOS, 33.6, 31.6, 34.8
BUS, 32.9, 34.2, 32.9
BIB, 32.2, 33.9, 33.9
BIT, 33.7, 33.5, 32.8
}\buildingNa
\pgfplotstablecreatecol[
create col/expr={
\thisrow{1} + \thisrow{2} + \thisrow{3}
}
]{sum}{\buildingNa}
\pgfplotstableread[col sep=comma, header=false]{
BOS, 31.0, 34.9, 34.1
BUS, 33.0, 33.8, 33.2
BIB, 32.9, 33.8, 33.3
BIT, 32.7, 33.4, 33.8
}\buildingPa
\pgfplotstablecreatecol[
create col/expr={
\thisrow{1} + \thisrow{2} + \thisrow{3}
}
]{sum}{\buildingPa}
\pgfplotsset{
percentage plot/.style={
point meta=explicit,
every node near coord/.append style={
xshift=17pt,
yshift=-3em,
anchor=east,
font=\small,
color=black,
align=center,
text width=1cm
},
nodes near coords align={vertical},
yticklabel=\pgfmathprintnumber{\tick}\,$\%$,
visualization depends on={y \as \originalvalue}
},
percentage series/.style={
table/y expr=(\thisrow{#1}/\thisrow{sum}*100),table/meta=#1
}
}
\begin{tikzpicture}
\begin{axis}[
title={\texttt{Building errors}},
ylabel={Feature importance},
ybar stacked,
height=6cm,
width=11cm,
enlarge x limits=0.15,
percentage plot,
symbolic x coords={BOS, BUS, BIB, BIT},
xtick=data,
x tick label style={rotate=45, anchor=east, xshift=-1.5mm, yshift=-2mm},
ymax=100,
ymin=0,
legend style={
at={(.5, -.25)},
legend columns=-2,
anchor=north
}
]
\addplot table [percentage series=1] {\buildingEl};
\addplot table [percentage series=2] {\buildingEl};
\addplot table [percentage series=3] {\buildingEl};
\legend{\strut Geometry, \strut Height, \strut Image}
\end{axis}
\begin{axis}[
ybar stacked,
bar shift=-15pt,
height=6cm,
width=11cm,
enlarge x limits=0.15,
percentage plot,
symbolic x coords={BOS, BUS, BIB, BIT},
xtick=data,
xticklabels={,,},
yticklabels={,,},
ymax=100,
ymin=0,
]
\addplot+ table [percentage series=1] {\buildingNa};
\addplot+ table [percentage series=2] {\buildingNa};
\addplot+ table [percentage series=3] {\buildingNa};
\end{axis}
\begin{axis}[
ybar stacked,
bar shift=15pt,
height=6cm,
width=11cm,
enlarge x limits=0.15,
percentage plot,
symbolic x coords={BOS, BUS, BIB, BIT},
xtick=data,
xticklabels={,,},
yticklabels={,,},
ymax=100,
ymin=0,
]
\addplot+ table [percentage series=1] {\buildingPa};
\addplot+ table [percentage series=2] {\buildingPa};
\addplot+ table [percentage series=3] {\buildingPa};
\end{axis}
\end{tikzpicture}
\end{document}