-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.tex
418 lines (397 loc) · 25.7 KB
/
README.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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage{subcaption}
\setmainfont{DejaVu Serif}
\author{Αντώνης Σκαρλάτος sdi1400184}
\title{READ ME}
\date{}
\begin{document}
\maketitle
Για την παραγωγή των φωτογραφιών χρησιμοποιήθηκε το module 'selenium' και ο κώδικας βρίσκεται
στο αρχείο convertHtmlToImage.py
\section*{Ερώτημα 1}
Ο κώδικας που παράγει τα .html αρχεία των πέντε διαφορετικών διαδρομών βρίσκεται στο αρχείο
drawTrajectories.py
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query1_0.png}
\captionof*{figure}{Trajectory 1}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query1_1.png}
\captionof*{figure}{Trajectory 2}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query1_2.png}
\captionof*{figure}{Trajectory 3}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query1_3.png}
\captionof*{figure}{Trajectory 4}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query1_4.png}
\captionof*{figure}{Trajectory 5}
\end{minipage} & \\
\hline
\end{tabular}
\end{center}
\section*{Ερώτημα 2}
Ο κώδικας για αυτό το ερώτημα βρίσκεται στον αρχείο search.py
Επίσης όλες οι αποστάσεις DTW, LCS, Haversine έχουν υλοποιηθεί από την αρχή
και βρίσκονται στο αρχείο distances.py. Στην απόσταση haversine γίνεται στρογγυλοποίηση
στα δύο δεκαδικά ψηφία. Ο τρόπος που βρίσκονται οι γείτονες
και για το DTW και για το LCS είναι μέσω bruteforce. Ελέγχοναι όλοι οι γείτονες
και ύστερα ταξινομούνται σε σχέση με την αποστασή τους. Στο τέλος διαλέγονται
οι πέντε κοντινότεροι γείτονες και δημιουργούνται τα plots. \\
Ο χρόνος Δt είναι κοινός για όλα τα plots γιατί μετράει πόσο χρόνο έκανε το πρόγραμμα για να
βρει για όλο το testSet όλους τους κοντινότερους γείτονες.
\begin{itemize}
\item Το DTW βρίσκει αρκετά ικανοποιητικά αποτελέσματα όπως φαίνεται και στις εικόνες παρακάτω.
Ο λόγος είναι ότι βρίσκει το συνολικό κόστος που πρέπει να κάνει κάποια κομμάτια "stretch" για να μοιάζει
η μία τροχιά στην άλλη.
\item Το LCS βρίσκει το μέγιστο subsequence των δύο τροχιών. Όπως φαίνεται και στις εικόνες παρακάτω, σε αντίθεση
με το DTW που θέλουμε να βρούμε το κόστος για να γίνουν οι τροχές παρόμοιες, στο LCS θέλουμε να δούμε κατά πόσο οι δύο
τροχιές μοιάζουν σε κάποια κομμάτια και πόσα είναι τα σημεία αυτά.
\end{itemize}
Γενικά, φαίνεται ότι με το DTW παίρνουμε τον πλησιέστερο γείτονα, ενώ με το LCS παίρνουμε τις τροχιές που μοιάζουν
σε κάποια κομμάτια, παρόλο που συνολικά μπορεί να είναι πολύ διαφορετικές στα υπόλοιπα κομμάτια.
\newpage
\subsection*{A-1)}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_0.png}
\captionof*{figure}{\footnotesize{Test Trip 1 \\ Δt=1575sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_0_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 01501001 \\ DTW: 0.0km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_0_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 01501001 \\ DTW: 3.57km}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_0_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 01501001 \\ DTW: 3.79km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_0_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 01501001 \\ DTW: 3.98km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_0_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 01501001 \\ DTW: 4.1km}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_1.png}
\captionof*{figure}{\footnotesize{Test Trip 2 \\ Δt=1575sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_1_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 01200001 \\ DTW: 0.0km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_1_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 01200001 \\ DTW: 2.73km}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_1_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 01200001 \\ DTW: 3.34km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_1_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 01200001 \\ DTW: 3.38km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_1_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 01200001 \\ DTW: 3.44km}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_2.png}
\captionof*{figure}{\footnotesize{Test Trip 3 \\ Δt=1575sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_2_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 00791001 \\ DTW: 0.0km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_2_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 00791001 \\ DTW: 4.69km}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_2_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 00791001 \\ DTW: 4.78km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_2_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 00791001 \\ DTW: 4.81km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_2_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 00791001 \\ DTW: 4.85km}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_3.png}
\captionof*{figure}{\footnotesize{Test Trip 4 \\ Δt=1575sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_3_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 00010002 \\ DTW: 0.0km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_3_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 00010002 \\ DTW: 2.49km}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_3_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 00010002 \\ DTW: 2.86km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_3_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 00010002 \\ DTW: 3.23km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_3_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 00010002 \\ DTW: 3.4km}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_4.png}
\captionof*{figure}{\footnotesize{Test Trip 5 \\ Δt=1575sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_4_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 01300001 \\ DTW: 0.0km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_4_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 01300001 \\ DTW: 4.29km}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_4_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 01300001 \\ DTW: 4.48km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_4_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 01300001 \\ DTW: 4.69km}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_DTW_4_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 01300001 \\ DTW: 4.7km}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\newpage
\subsection*{A-2)}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_0.png}
\captionof*{figure}{\footnotesize{Test Trip 1 \\ Δt=1110sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_0_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 78}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_0_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 78}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_0_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 76}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_0_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 76}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_0_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 75}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_1.png}
\captionof*{figure}{\footnotesize{Test Trip 2 \\ Δt=1110sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_1_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 82}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_1_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 78}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_1_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 75}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_1_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 74}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_1_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 040D1002 \\ Matching Points: 73}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_2.png}
\captionof*{figure}{\footnotesize{Test Trip 3 \\ Δt=1110sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_2_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 01451008 \\ Matching Points: 40}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_2_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 00790001 \\ Matching Points: 40}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_2_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 079A0001 \\ Matching Points: 40}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_2_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 01451001 \\ Matching Points: 40}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_2_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 067X0001 \\ Matching Points: 40}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_3.png}
\captionof*{figure}{\footnotesize{Test Trip 4 \\ Δt=1110sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_3_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 00790001 \\ Matching Points: 59}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_3_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 00790001 \\ Matching Points: 59}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_3_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 00790001 \\ Matching Points: 59}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_3_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 00790001 \\ Matching Points: 59}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_3_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 00790001 \\ Matching Points: 59}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_4.png}
\captionof*{figure}{\footnotesize{Test Trip 5 \\ Δt=1110sec}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_4_0.png}
\captionof*{figure}{\footnotesize{Neighbor 1 \\ JP\textunderscore ID: 01200001 \\ Matching Points: 73}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_4_1.png}
\captionof*{figure}{\footnotesize{Neighbor 2 \\ JP\textunderscore ID: 01200001 \\ Matching Points: 73}}
\end{minipage} \\
\hline
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_4_2.png}
\captionof*{figure}{\footnotesize{Neighbor 3 \\ JP\textunderscore ID: 01200002 \\ Matching Points: 72}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_4_3.png}
\captionof*{figure}{\footnotesize{Neighbor 4 \\ JP\textunderscore ID: 01200001 \\ Matching Points: 71}}
\end{minipage} &
\begin{minipage}[t]{0.33\linewidth}
\includegraphics[width=4cm,height=4cm]{static/query2_LCS_4_4.png}
\captionof*{figure}{\footnotesize{Neighbor 5 \\ JP\textunderscore ID: 01200001 \\ Matching Points: 71}}
\end{minipage} \\
\hline
\end{tabular}
\end{center}
\section*{Ερώτημα 3}
Τα αποτελέσματα του classification βρίσκονται στο αρχείο \\
testSet\textunderscore JourneyPatternIDs.csv
Το 10-cross-validation έγινε περίπου με το $5\%$ του dataset.
Voting schemes
\begin{itemize}
\item Ένα voting scheme που δοκιμάστηκε είναι να βλέπουμε ποιο patternId βρίσκεται τις περισσότερες φορές από τα πέντε
κοντινότερα και να επιλέγουμε αυτό ως πλησιέστερο γείτονα. Σε ισοπαλίες διαλέγουμε τυχαία. \\
10-cross-validation accuracy = $80\%$
\item Ένα άλλο voting scheme που δοκιμάστηκε είναι να βλέπουμε ποιο patternId έχει την μεγαλύτερη τιμή στο
άθροισμα των $1 / (dist + 0.01)$ από τα πέντε κοντινότερα. Όσο πιο μικρό είναι το dist(δηλαδή πιο κοντά) τόσο μεγαλύτερο
γίνεται το άθροισμα. Αυτό, σε αντίθεση με το προηγούμενο voting scheme βάζει κάποια βάρη. Αυτό σημαίνει ότι δεν μας
ενδιαφέρει μόνο η σειρά που βρίσκονται οι γείτονες ως προς την απόσταση, αλλά και η ίδια η απόσταση ως τιμή, για την τελική
επιλογή. Σε ισοπαλίες διαλέγουμε τυχαία. \\
10-cross-validation accuracy = $75\%$
\end{itemize}
Γενικά ο KNN είναι ένας αλγόριθμος που χρησιμοποιείται αρκετά στην πράξη επειδή είναι απλός και διαισθητικός,
αλλά εξαρτάται για την απόδοση και η μετρική που χρησιμοποιείται. Στην περιπτωσή μας δεν παίρνουμε άσχημα αποτελέσματα
αλλά ούτε και ιδανικά με βάση την απόδοση που μας δίνει το cross validation.
\end{document}