-
Notifications
You must be signed in to change notification settings - Fork 0
/
PToPI.dot
273 lines (257 loc) · 15 KB
/
PToPI.dot
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# Binary-Classification Performance Instruments Dependency Graph
# Author: Gürol Canbek, [email protected]
# Version: 1.5
# Last Update Date: 26 May 2020
# First Date: 19 September 2017
#
# This file is licensed under
#
# G N U A F F E R O G E N E R A L P U B L I C L I C E N S E
# V e r s i o n 3 , 1 9 N o v e m b e r 2 0 0 7
#
# perfscheme – Visualized Scheme for Binary-Classification Performance Evaluation
# Copyright (C) 2017-2020 Gürol Canbek
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# See the full notice license file in <https://github.com/gurol/ptopi>
#
# Usage (graphviz must be installed):
# dot -Tpdf PToPI.dot -o PToPI.pdf
digraph BinClassRoadMap {
size = "32, 24"
dpi = 96.0
forcelabels = true
# subgraph cluster_base_measures {
# TP FP FN TN
# label="BaseMeasures"
# }
# Nodes for base measures
TP[label=<<b><i>TP</i></b>> style="filled" fillcolor="#ffcccc" fontcolor="#cc0000" penwidth=1.0]
FP[label=<<b><i>FP</i></b>> style="filled" fillcolor="#ccffcc" fontcolor="#5e0002" penwidth=1.0]
FN[label=<<b><i>FN</i></b>> style="filled" fillcolor="#ffcccc" fontcolor="#005e02" penwidth=1.0]
TN[label=<<b><i>TN</i></b>> style="filled" fillcolor="#ccffcc" fontcolor="#009900" penwidth=1.0]
# Nodes for 1st level measures
P[label=<<b><i>P</i></b>> style="filled" fillcolor="#990000" fontcolor="#ff5050" penwidth=2.5]
N[label=<<b><i>N</i></b>> style="filled" fillcolor="#006600" fontcolor="#33cc33" penwidth=2.5]
OP[label=<<b><i>OP</i></b>> style="filled" fillcolor="#cc9999" fontcolor="#ffcccc" penwidth=2.5]
ON[label=<<b><i>ON</i></b>> style="filled" fillcolor="#99cc99" fontcolor="#ccffcc" penwidth=2.5]
TC[label=<<b><i>TC</i></b>> style="filled" fillcolor="#77cccc" fontcolor="#117777" penwidth=2.5]
FC[label=<<b><i>FC</i></b>> style="filled" fillcolor="#ffccff" fontcolor="#7030a0" penwidth=2.5]
Sn[label=<<b><i>Sn</i></b>> style="filled" fillcolor="#999966" fontcolor="black" penwidth=2.5]
# Nodes for 2nd level measures
PREV[label=<<b><i>PREV</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
PREV_FOR_METRICS[label=<<b><i>PREV2</i></b>> style=invis]
BIAS[label=<<b><i>BIAS</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
BIAS_FOR_METRICS[label=<<b><i>PREV2</i></b>> style=invis]
SKEW[label=<<b><i>SKEW</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
NIR[label=<<b><i>NIR</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
NER[label=<<b><i>NER</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
CKc[label=<<b><i>CKc</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
LRP[label=<<b><i>LRP</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
LRN[label=<<b><i>LRN</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
DPR[label=<<b><i>DPR</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5]
# Nodes for 3rd level measures
HC[label=<<i>HC</i>> style="filled" fillcolor="#f2f2f2" fontcolor="black" penwidth=4.5]
HO[label=<<i>HO</i>> style="filled" fillcolor="#f2f2f2" fontcolor="black" penwidth=4.5]
OR[label=<<b><i>OR</i></b>> style="filled" fillcolor="#f2f2f2" fontcolor="black" penwidth=6.0]
DP[label=<<b><i>DP</i></b>> style="filled" fillcolor="#f2f2f2" fontcolor="black" penwidth=6.0]
# Nodes for base metrics
TPR[label=<<b><i>TPR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
FNR[label=<<b><i>FNR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
TNR[label=<<b><i>TNR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
FPR[label=<<b><i>FPR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
PPV[label=<<b><i>PPV</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
FDR[label=<<b><i>FDR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
FOR[label=<<b><i>FOR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
NPV[label=<<b><i>NPV</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
HOC[label=<<b><i>HOC</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
MI[label=<<b><i>MI</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
ACC[label=<<b><i>ACC</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
MCR[label=<<b><i>MCR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
DR[label=<<b><i>DR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
CRR[label=<<b><i>CRR</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0]
# Nodes for 1st level metrics
INFORM[label=<<b><i>INFORM</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
MARK[label=<<b><i>MARK</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
BACC[label=<<b><i>BACC</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
G[label=<<b><i>G</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
nMI[label=<<b><i>nMI</i></b>> style="filled" color="#bf5807" fillcolor="#ffd966" fontcolor="#bf5807" penwidth=2.5]
Fmetrics[label=<<b><i>Fmetrics</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
CK[label=<<b><i>CK</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
# Nodes for 2nd level metric
MCC[label=<<b><i>MCC</i></b>> style="filled" color="#e66a09" fillcolor="#fff2cc" fontcolor="#e66a09" penwidth=5.0]
# Nodes for Graphic based metrics
TPRs[label=<<b><i>TPRs</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0 peripheries=2]
TNRs[label=<<b><i>TNRs</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0 peripheries=2]
PPVs[label=<<b><i>PPVs</i></b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#984707" penwidth=1.0 peripheries=2]
AUCROC[label=<<b><i>AUCROC</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
AUCPR[label=<<b><i>AUCPR</i></b>> style="filled" color="#bf5807" fillcolor="#ffe699" fontcolor="#bf5807" penwidth=2.5]
# Nodes for Probabilistic error/loss measures
LogLoss[label=<<b><i>LogLoss</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5 xlabel=<<i>ci - pi</i><br/><i>(1 - ci)(1 - pi)</i>>]
MSE[label=<<b><i>MSE</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5 xlabel="mean e^2"]
MAE[label=<<b><i>MAE</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5 xlabel="mean |e|"]
RMSE[label=<<b><i>RMSE</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5 xlabel="mean √(e^2)"]
ME[label=<<b><i>ME</i></b>> style="filled" fillcolor="#d9d9d9" fontcolor="black" penwidth=4.5 xlabel="max |e|"]
TypeIerror[label=<<b>Type I error<br/>(~<i>FPR</i>)</b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
TypeIIerror[label=<<b>Type II error<br/>(~<i>FNR</i>)</b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
UncertaintyInN[label=<<b>Uncertainty<br/><i>FP</i> in <i>N</i> (~<i>FPR</i>)</b>> style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
UncertaintyInP[label=<<b>Uncertainty<br/><i>FN</i> in <i>P</i> (~<i>FPR</i>)</b>>style="filled" color="#984707" fillcolor="#ffd966" fontcolor="#a6a6a6" penwidth=1.0]
# Edges for measures dependencies
P -> TP [label="+5" style=invis]
P -> FN [label="+5" style=invis]
N -> FP [label="+6" style=invis]
N -> TN [label="+6" style=invis]
OP -> TP [label="+7" style=invis]
OP -> FP [label="+7" style=invis]
ON -> FN [label="+8" style=invis]
ON -> TN [label="+8" style=invis]
TC -> TP [label="+9" style=invis]
TC -> TN [label="+9" style=invis]
FC -> FP [label="+10" style=invis]
FC -> FN [label="+10" style=invis]
Sn -> TP [label="+11" style=invis]
Sn -> FP [label="+11" style=invis]
Sn -> TN [label="+11" style=invis]
Sn -> FN [label="+11" style=invis]
PREV -> P [label="12" style=invis]
PREV -> Sn [label="/12" style=invis]
# Dummy: For the metrics depended on PREV not to increase the level extra
PREV_FOR_METRICS -> TP [label="12" style=invis]
PREV_FOR_METRICS -> FN [label="12" style=invis]
BIAS -> OP [label="13" style=invis]
BIAS -> Sn [label="13" style=invis]
# Dummy: For the metrics depended on PREV not to increase the level extra
BIAS_FOR_METRICS -> TP [label="12.1" style=invis]
BIAS_FOR_METRICS -> FP [label="12.1" style=invis]
SKEW -> N [label="14" style=invis]
SKEW -> P [label=":14" style=invis]
NIR -> P [label="15 max" style=invis]
NIR -> N [label="15 max" style=invis]
NIR -> Sn [label="/15" style=invis]
NER -> N [label="16" style=invis]
NER -> Sn [label="/16" style=invis]
CKc -> P [label="17.1*" style=invis]
CKc -> OP [label="17.1*" style=invis]
CKc -> N [label="17.2*" style=invis]
CKc -> ON [label="17.2*" style=invis]
CKc -> Sn [label="/17" style=invis]
LRP -> TPR [label="19" style=invis]
LRP -> FPR [label="/19" style=invis]
LRN -> FNR [label="20" style=invis]
LRN -> TNR [label="/20" style=invis]
DPR -> TPR [label="21 z()" style=invis]
# Z(1-TNR)
DPR -> FPR [label="21 z()" style=invis]
# Not to increase the level due to the 1st level measure PREV
HC -> PREV_FOR_METRICS [label="22" style=invis]
# Not to increase the level due to the 1st level measure BIAS
HO -> BIAS_FOR_METRICS [label="23" style=invis]
OR -> LRP [label="24" style=invis]
OR -> LRN [label="/24" style=invis]
DP -> LRP [label="25" style=invis]
DP -> LRN [label="/25" style=invis]
DP -> OR [style="dotted"]
{rank=same DP OR}
# Edges for metrics dependencies
TPR -> TP [label="1" color="#984707" style=invis]
TPR -> P [label="/1" color="#984707" style=invis]
FNR -> FN [label="2" color="#984707" style=invis]
FNR -> P [label="/2" color="#984707" style=invis]
TNR -> TN [label="3" color="#984707" style=invis]
TNR -> N [label="/3" color="#984707" style=invis]
FPR -> FP [label="4" color="#984707" style=invis]
FPR -> N [label="/4" color="#984707" style=invis]
PPV -> TP [label="5" color="#984707" style=invis]
PPV -> OP [label="/5" color="#984707" style=invis]
FDR -> FP [label="6" color="#984707" style=invis]
FDR -> OP [label="/6" color="#984707" style=invis]
FOR -> FN [label="7" color="#984707" style=invis]
FOR -> ON [label="/7" color="#984707" style=invis]
NPV -> TN [label="8" color="#984707" style=invis]
NPV -> ON [label="/8" color="#984707" style=invis]
HOC -> TP [label="+9" color="#984707" style=invis]
HOC -> FP [label="+9" color="#984707" style=invis]
HOC -> FN [label="+9" color="#984707" style=invis]
HOC -> TN [label="+9" color="#984707" style=invis]
HOC -> Sn [label="/9" color="#984707" style=invis]
MI -> TP [label="+10" color="#984707" style=invis]
MI -> FP [label="+10" color="#984707" style=invis]
MI -> FN [label="+10" color="#984707" style=invis]
MI -> TN [label="+10" color="#984707" style=invis]
MI -> PREV_FOR_METRICS [label="/10" color="#984707" style=invis]
MI -> BIAS_FOR_METRICS [label="/10" color="#984707" style=invis]
DR -> TP [label="11" color="#984707" style=invis]
DR -> Sn [label="/11" color="#984707" style=invis]
CRR -> TN [label="12" color="#984707" style=invis]
CRR -> Sn [label="/12" color="#984707" style=invis]
ACC -> TC [label="" color="#984707"]
ACC -> Sn [label="/" color="#984707"]
MCR -> FC [label="14" color="#984707" style=invis]
MCR -> Sn [label="/14" color="#984707" style=invis]
# TPRs -> TP [label="1" color="#984707" style=invis]
# TPRs -> P [label="/1" color="#984707" style=invis]
# TNRs -> TN [label="3" color="#984707" style=invis]
# TNRs -> N [label="/3" color="#984707" style=invis]
# PPVs -> TP [label="5" color="#984707" style=invis]
# PPVs -> OP [label="/5" color="#984707" style=invis]
# 1st level metrics
# 15
INFORM -> TPR [label="+" color="#bf5807"]
INFORM -> TNR [label="+" color="#bf5807"]
# 16
MARK -> PPV [label="+" color="#bf5807"]
MARK -> NPV [label="+" color="#bf5807"]
# 17
BACC -> TPR [label="+/2" color="#bf5807"]
BACC -> TNR [label="+/2" color="#bf5807"]
# 18
G -> TPR [label="√*" color="#bf5807"]
G -> TNR [label="√*" color="#bf5807"]
# 19
nMI -> MI [label="" color="#bf5807"]
nMI -> HC [label="" color="#bf5807"]
nMI -> HO [label="" color="#bf5807"]
# 20-22
Fmetrics -> PPV [label="" color="#bf5807"]
Fmetrics -> TPR [label="" color="#bf5807"]
# 23
CK -> ACC [label="+" color="#bf5807"]
CK -> CKc [label="-, /" color="#bf5807"]
# 2nd level metric (24)
MCC -> INFORM [label="√*" color="#e66a09"]
MCC -> MARK [label="√*" color="#e66a09"]
# Nodes for Graphic based metrics
AUCROC -> TPRs [label="+" color="#bf5807" style="dashed"]
AUCROC -> TNRs [label="+" color="#bf5807" style="dashed"]
AUCPR -> PPVs [label="+" color="#bf5807" style="dashed"]
AUCPR -> TPRs [label="+" color="#bf5807" style="dashed"]
{rank=same TPRs TNRs PPVs TPR}
# Nodes for Probabilistic error/loss measures
LogLoss -> UncertaintyInP [label="" color="#d9d9d9" style="dashed"]
LogLoss -> UncertaintyInN [label="" color="#d9d9d9" style="dashed"]
MSE -> TypeIerror [label="" color="#a6a6a6" style="dashed"]
MSE -> TypeIIerror [label="" color="#a6a6a6" style="dashed"]
MAE -> TypeIerror [label="" color="#a6a6a6" style="dashed"]
MAE -> TypeIIerror [label="" color="#a6a6a6" style="dashed"]
RMSE -> TypeIerror [label="" color="#a6a6a6" style="dashed"]
RMSE -> TypeIIerror [label="" color="#a6a6a6" style="dashed"]
ME -> TypeIerror [label="" color="#a6a6a6" style="dashed"]
ME -> TypeIIerror [label="" color="#a6a6a6" style="dashed"]
{rank=same UncertaintyInP UncertaintyInN TypeIerror TypeIIerror FPR FNR}
# {rank=same TP FP FN TN}
# {rank=same TP FP FN TN}
# {rank=same P N OP ON TC FC}
# {rank=same TPR FPR FNR TNR}
# {rank=same PPV FDR FOR NPV}
}