forked from thomaskeck/MultivariateClassificationLecture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_neyman_pearson_lemma.tex
316 lines (285 loc) · 11.2 KB
/
1_neyman_pearson_lemma.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
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
\section[np]{Neyman-Pearson Lemma / Supervised Learning}
\begin{frame}
\frametitle{Simple example in two dimensions}
\begin{center}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{dataset_orange.png}};
\onslide<2>{\node[anchor=south west,inner sep=0] (signal) at (4,2.0) {\includegraphics[width=0.5\textwidth]{signal_pdf.png}};
\begin{scope}[x={(signal.south east)},y={(signal.north west)}]
\node[inner sep=0] at (0.4,0.8) {\large{Signal $PDF(\vec{x} | S)$}};
\end{scope}
}
\onslide<3>{\node[anchor=south west,inner sep=0] (background) at (1.8,1.2) {\includegraphics[width=0.6\textwidth]{background_pdf.png}};
\begin{scope}[x={(background.south east)},y={(background.north west)}]
\node[inner sep=0] at (0.4,0.8) {\large{Background $PDF(\vec{x} | B)$}};
\end{scope}
}
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Neyman-Pearson Lemma}
\begin{center}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,2) {\includegraphics[width=\textwidth]{npl.png}};
\node[anchor=south west,inner sep=0] (image) at (0,-0.8) {\Huge{$f(\vec{x}) = \frac{PDF(\vec{x} | S)}{PDF(\vec{x} | B)} = $}};
\draw[anchor=south west, thick] (6.8,0) -- (10.6,0);
\node[anchor=south west,inner sep=0] (image) at (7,0.1) {\includegraphics[width=0.3\textwidth]{signal_pdf.png}};
\node[anchor=south west,inner sep=0] (image) at (7,-2.1) {\includegraphics[width=0.3\textwidth]{background_pdf.png}};
\end{tikzpicture}
\large{Most powerful test at a given significance level to distinguish between two simple hypotheses (signal or background)}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Neyman-Pearson Lemma}
\begin{center}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{np_classifier.png}};
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Neyman-Pearson Lemma}
\begin{center}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{np_statistic.png}};
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Problem solved? No!}
\begin{center}
\begin{itemize}
\item Howto obtain the signal and background PDFs?
\begin{itemize}
\item Usually unknown!
\item Multiple sources of signal and background
\item Non gaussian PDF
\item Nonlinear dependencies among observables
\item Cannot be sampled in high dimensions (e.g. cannot fill 80-dimensional histogram with enough statistics)
\item $\rightarrow$ ,,Curse of dimensionality''
\end{itemize}
\end{itemize}
\begin{tikzpicture}
\foreach \x in{0,...,1}
{
\draw (-7,\x*0.2 -0.8) -- (-5,\x*0.2-0.8 );
}
\foreach \x in{0,...,10}
{
\draw (\x*0.2-7 ,-0.8) -- (\x*0.2-7 ,-0.6);
}
\foreach \x in{0,...,10}
{
\draw (-4,\x*0.2 -0.8) -- (-2,\x*0.2 -0.8 );
\draw (\x*0.2-4 ,-0.8) -- (\x*0.2-4 , 2-0.8);
}
\foreach \x in{0,...,10}
{
\draw (0,\x*0.2 ,2) -- (2,\x*0.2 ,2);
\draw (\x*0.2 ,0,2) -- (\x*0.2 ,2,2);
\draw (2,\x*0.2 ,2) -- (2,\x*0.2 ,0);
\draw (\x*0.2 ,2,2) -- (\x*0.2 ,2,0);
\draw (2,0,\x*0.2 ) -- (2,2,\x*0.2 );
\draw (0,2,\x*0.2 ) -- (2,2,\x*0.2 );
}
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Solution: Approximate Neyman-Pearson}
\vspace{-1em}
\begin{columns}
\column{0.6\textwidth}
\begin{itemize}
\item Neyman-Pearson Lemma
\end{itemize}
\column{0.4\textwidth}
\vspace{1em}
\Large{$$f(\vec{x}) = \frac{PDF(\vec{x} | S)}{PDF(\vec{x} | B)}$$}
\end{columns}
\vspace{-2em}
\begin{columns}
\column{0.6\textwidth}
\begin{itemize}
\item Generative Models
\begin{itemize}
\item Analytical approx. (LDA, QDA)
\item Restricted Boltzmann machine
\item Kernel density estimator
\item Gaussian mixture model
\end{itemize}
\end{itemize}
\column{0.4\textwidth}
\vspace{1em}
\Large{\begin{align*}f(\vec{x} | S) &\approx PDF(\vec{x} | S) \\ f(\vec{x} | B) &\approx PDF(\vec{x} | B)\end{align*}}
\end{columns}
\vspace{-1em}
\begin{columns}
\column{0.6\textwidth}
\begin{itemize}
\item Discriminative Models
\begin{itemize}
\item (Boosted) Decision Trees
\item Support Vector Machines
\item Artificial Neural Networks
\end{itemize}
\end{itemize}
\column{0.4\textwidth}
\vspace{1em}
\Large{\begin{align*}f(\vec{x}) &\approx \frac{PDF(\vec{x} | S)}{PDF(\vec{x} | B)}\end{align*}}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{Supervised Learning / How to obtain a model?}
\vspace{-1em}
\begin{center}
\begin{tikzpicture}[scale=1.0]
\node at (0,2.3) {
\textbf{Model} $f(\vec{x}, \vec{w}) = \textrm{label}$ \textbf{with unknown parameters} $\vec{w}$
};
\onslide<2->{
\node at (-3,1.6) {
\textbf{Training Dataset with Labels}
};
\node at (-3,0) {
\begin{tabular}{rrr}
\toprule
x & y & label \\
\midrule
$-1.5$ & $-0.2$ & $0$ \\
$-0.1$ & $0.9$ & $1$ \\
$-0.2$ & $0.2$ & $0$ \\
\multicolumn{3}{c}{\dots} \\
\bottomrule
\end{tabular}
};
}
\onslide<3->{
\draw [very thick, ->] (-1,0) -- (2,0)
node[above, xshift=-4em] {Training} node[below, xshift=-4em] {Fitting};
\node at (4,0) {Parameters $\vec{w}$};
}
\onslide<4->{
\node at (-3,-2.0) {
\textbf{Test Dataset without Labels}
};
\node at (-3,-3.6) {
\begin{tabular}{rrr}
\toprule
x & y & label \\
\midrule
$-0.6$ & $0.4$ & ? \\
$ 0.1$ & $-0.7$ & ? \\
$ 0.1$ & $1.2$ & ? \\
\multicolumn{3}{c}{\dots} \\
\bottomrule
\end{tabular}
};
}
\onslide<5->{
\draw [very thick, ->] (-1,-3.6) -- (2,-3.6)
node[above, xshift=-4em] {Application} node[below, xshift=-4em] {Inference};
\node at (4,-3.6) {
\begin{tabular}{rrr}
\toprule
x & y & label \\
\midrule
$-0.6$ & $0.4$ & 0\\
$ 0.1$ & $-0.7$ & 0 \\
$ 0.1$ & $1.2$ & 1 \\
\multicolumn{3}{c}{\dots} \\
\bottomrule
\end{tabular}
};
}
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Example: Linear Model}
\begin{align*}
f(\vec{x}, \vec{w}) &= \vec{x} \cdot \vec{w}
\end{align*}
\begin{center}
\begin{tikzpicture}
\node[anchor=center,inner sep=0] (image) at (0,0) {\includegraphics[width=0.8\textwidth]{dataset_orange.png}};
\onslide<2-3>{
\draw[name path=A, line width=0.05 cm] (0,2.3) -- (0, -2.3);
\node at (0,2.6) {$\vec{w} = (0, 1)\quad$ ?};
}
\onslide<3>{
\draw [name path=B1] plot [smooth] coordinates {(0,2) (-1.5,0.8) (-0.5,0) (-1,-1) (0,-2)};
\tikzfillbetween[of=A and B1] {fill=blue,fill opacity=0.4};
\draw [name path=B2] plot [smooth] coordinates {(0,2) (0.7,1.0) (0.6,0) (1,-0.5) (0,-2)};
\tikzfillbetween[of=A and B2] {fill=orange,fill opacity=0.4};
}
\onslide<4-5>{
\draw[name path=C, line width=0.05 cm] (-3,-0.5) -- (3, 0.5);
\node at (0,2.6) {$\vec{w} = (6, 1)\quad$ !};
}
\onslide<5>{
\draw [name path=D1] plot [smooth] coordinates {(-3,-0.5) (-1,1.5) (0,0.5) (1,0.3) (3,0.5)};
\tikzfillbetween[of=C and D1] {fill=blue,fill opacity=0.4};
\draw [name path=D2] plot [smooth] coordinates {(-3,-0.5) (-1,-0.3) (0,-0.5) (1,-1.5) (3,0.5)};
\tikzfillbetween[of=C and D2] {fill=orange,fill opacity=0.4};
}
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}
\frametitle{More Questions}
\begin{center}
\begin{itemize}
\item \textbf{How to obtain training data required for these models?}
\begin{itemize}
\item In industry usually historical data ($\rightarrow$ time-series)
\item In HEP usually simulated data ($\rightarrow$ systematics)
\item Sometimes we can use real data ($\rightarrow$ data-driven techniques)
\end{itemize}
\item \textbf{How to train, optimize and evaluate the quality of the models and compare them?}
\begin{itemize}
\item Train model on training data ($\rightarrow$ regularization techniques)
\item Optimize model on validation data ($\rightarrow$ hyper-parameter optimization)
\item Test model on test data ($\rightarrow$ ROC curves)
\item Apply model on unlabeled data ($\rightarrow$ systematics)
\end{itemize}
\end{itemize}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Classification Quality}
\begin{center}
\begin{itemize}
\item Misclassification Rate (= Fraction of wrongly classifier events)
\item Type I Error (= False Positive Rate)
\item Type II Error (= 1 - True Positive Rate)
\end{itemize}
\vspace{1em}
\textbf{Problem: Depends on the chosen cut on the classifier output!}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Classification Quality}
\textbf{Solution: Receiver operating characteristic}\\
{\small Visualizes the false positive rate (fpr) as a function of the true positive rate (tpr)}\\
\vspace*{1em}
\textbf{More General}\\
{\small Visualizes two mutually exclusive objectives as a curve in a plane}\\
\begin{center}
\includegraphics[width=0.5\textwidth]{np_roc.png}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Classification Quality}
\begin{center}
\begin{tikzpicture}
\onslide<1>{\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{np_statistic.png}};}
\onslide<2>{\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{np_statistic_cut.png}};}
\onslide<3>{\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{np_statistic_cut_zoomed.png}};}
\onslide<4>{\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{np_roc.png}};}
\onslide<5>{\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=\textwidth]{np_roc_shaded.png}};}
\onslide<5>{\node at (6, 3) {\large{Allowed Region for an arbitrary classifier}};}
\end{tikzpicture}
\end{center}
\end{frame}