-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.tex
369 lines (319 loc) · 10 KB
/
main.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
\documentclass[twoside,a5paper,10pt,openright]{memoir}
% \setstocksize{230mm}{160mm}
\setlrmarginsandblock{23mm}{20mm}{*}
\setulmarginsandblock{20mm}{20mm}{*}
\checkandfixthelayout
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[style=authoryear,maxbibnames=99,giveninits=true,backref=true]{biblatex}
\addbibresource{references.bib}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{blkarray}
\usepackage[colorlinks]{hyperref}
\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{sourcesanspro}
\usepackage{unicode-math}
\usepackage{graphicx}
\usepackage[super]{nth}
\usepackage{booktabs}
\usepackage{csquotes}
\usepackage{multirow}
\usepackage[table]{xcolor}
\usepackage{titletoc}
\usepackage[noend,noline,linesnumbered]{algorithm2e}
\usepackage[automake]{glossaries-extra}
\usepackage{orcidlink}
\usepackage{fontawesome5}
\usepackage{nicefrac}
\usepackage{cancel}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator{\Prob}{P}
\DeclareMathOperator{\E}{E}
\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\sign}{sign}
\usepackage[Bjornstrup]{fncychap} % must come before cleveref to avoid break appendix name
\usepackage{cleveref}
\newcommand\pcref[1]{(\cref{#1})}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows.meta, positioning, shapes.geometric}
\usetikzlibrary{fit}
\usetikzlibrary {datavisualization.formats.functions}
\usepackage{pgfplots}
\makeatletter
\newcommand{\gnuplotResult}{}
\newcommand*{\gnuplotInvnorm}[2][\jobname.gnuplot]{%
\immediate\write18{gnuplot -e "set print '#1'; print invnorm(#2)"}%
\IfFileExists{#1}{%
\renewcommand{\gnuplotResult}{\input{#1}}%
}{%
\PackageError{gnuplotInvnorm}{File `#1' not found}{%
The file `#1' could not be found. Maybe you need to enable \write18.%
}%
}%
}%
\newcommand*{\gnuplotNorm}[2][\jobname.gnuplot]{%
\immediate\write18{gnuplot -e "set print '#1'; print norm(#2)"}%
\IfFileExists{#1}{%
\renewcommand{\gnuplotResult}{\input{#1}}%
}{%
\PackageError{gnuplotNorm}{File `#1' not found}{%
The file `#1' could not be found. Maybe you need to enable \write18.%
}%
}%
}%
\def\pgfdvmathinvnorm#1#2{%
% Remove prefix "1Y" and suffix "]" in #2
\gnuplotInvnorm{#2}%
\let#1=\gnuplotResult%
}%
\makeatother
\tikzset{%
decision/.style={draw, diamond, text centered, minimum height=0.5cm, minimum width=1cm},
block/.style={rectangle, draw, text width=6em, text centered, rounded corners, minimum height=3em},
mediumblock/.style={rectangle, draw, text width=3em, text centered, rounded corners, minimum height=2em},
darkblock/.style={block, fill=gray, text=white},
smallblock/.style={rectangle, rounded corners, draw, font=\tiny, minimum height=1em, inner sep=2pt},
smalldarkblock/.style={smallblock, fill=gray, text=white},
darkcircle/.style={draw, circle, fill=gray, text centered, text=white},
smallcircle/.style={draw, circle, text centered, font=\tiny},
smalldarkcircle/.style={smallcircle, fill=gray, text=white},
line/.style={draw, -latex},
dline/.style={draw, latex-latex},
bigarrow/.style={draw, -latex, line width=3pt, gray}}
\usepackage{titling}
\usepackage[most]{tcolorbox}
\usepackage{xhfill}
\usepackage{qrcode}
\newcommand{\linkwithqr}[1]{%
\begin{minipage}{0.8\textwidth}
\url{#1}
\end{minipage}
\hfill
\begin{minipage}{0.15\textwidth}
\qrcode[height=\textwidth]{#1}
\end{minipage}
}
\newcommand{\aurl}{google.com}
\newenvironment{parwithqr}[1]{%
\renewcommand\aurl{#1}%
\noindent%
\begin{minipage}{0.75\textwidth}%
}{%
\end{minipage}%
\hfill%
\begin{minipage}{0.20\textwidth}%
\qrcode[height=\textwidth]{\aurl}%
\end{minipage}%
}
\newenvironment{lparwithqr}[1]{%
\renewcommand\aurl{#1}%
\noindent%
\begin{minipage}{0.20\textwidth}%
\qrcode[height=\textwidth]{\aurl}%
\end{minipage}%
\hfill%
\begin{minipage}{0.75\textwidth}%
}{%
\end{minipage}%
}
\nonfrenchspacing
\setsecnumdepth{subsection}
\maxtocdepth{subsection}
\babelhyphenation[english]{par-a-digm}
\newtcolorbox[auto counter, number within=chapter, crefname={algorithm}{algorithms}]{algobox}[2][]{%
float=thbp, base={Algorithm \thetcbcounter: #2},
colframe=black!20!white, #1,
before upper={\begin{algorithm}[H]},
after upper={\end{algorithm}}}
\input{glossary}
\begin{document}
\setmathfont{STIXTwoMath}[
Extension={.otf},
Path={./fonts/},
Scale=1]
\setmainfont{STIXTwoText}[
Extension={.otf},
Path={./fonts/},
UprightFont={*-Regular},
BoldFont={*-Bold},
ItalicFont={*-Italic},
BoldItalicFont={*-BoldItalic}]
\setmonofont{CourierPrime}[
Extension={.ttf},
Path={./fonts/},
UprightFont={*-Regular},
BoldFont={*-Bold},
ItalicFont={*-Italic},
BoldItalicFont={*-BoldItalic},
Scale=0.9]
\newcommand{\code}[1]{\colorbox{black!10!white}{\texttt{#1}}}
%\setsansfont{SourceSansPro}
\urlstyle{rm}
\tcbset {
base/.style={
arc=0mm,
bottomtitle=0.5mm,
boxrule=0mm,
colbacktitle=black!20!white,
coltitle=black,
left=2.5mm,
leftrule=1mm,
right=3.5mm,
title={#1},
toptitle=0.75mm,
lower separated=false,
}
}
\newtcbtheorem[auto counter, number within=chapter]{defbox}{Definition}{
float=h!,
colframe=black!20!white,
description delimiters parenthesis,
label type=definition,
base
}{def}
\newtcolorbox{mainbox}[1]{
float=ht,
spread outwards=-2mm,
spread inwards=-2mm,
%spread downwards,
colframe=black!20!white,
fonttitle=\bfseries,
base={#1},
left=16mm,
right=19mm,
}
\newtcolorbox{hlbox}[1]{
float=h,
colframe=black!20!white,
fonttitle=\bfseries,
base={#1},
}
\newtcolorbox[blend into=figures]{figurebox}[2][]{%
float=thbp, base={#2},
colframe=black!20!white,
every float=\centering, #1}
\newtcolorbox[blend into=tables]{tablebox}[2][]{%
float=thbp, base={#2},
colframe=black!20!white,
every float=\centering, #1}
\newcommand\boxsubtitle[1]{%
\vspace{0.5em}
\noindent\xrfill[0.5ex]{1pt}[black!20]\phantom{x}\textbf{#1}\phantom{x}\xrfill[0.5ex]{1pt}[black!20]%
\vspace{0.5em}
}
\renewcommand{\vec}[1]{\mathbf{#1}}
\title{Data science project: an inductive learning approach}
\author{Filipe A. N. Verri}
\hypersetup{%
pdftitle={\thetitle},
pdfsubject={Data science},
pdfauthor={\theauthor},
pdfkeywords={data science, statistics, machine learning, databases},
urlcolor=black!60,
linkcolor=black,
citecolor=black,}
\begin{titlingpage}
\begin{tikzpicture}[remember picture, overlay]
\fill[black!80] (current page.south west) rectangle (current page.north east);
\node[anchor=south east, inner sep=0mm] at (current page.south east) {%
\reflectbox{\includegraphics[width=\paperwidth]{images/bard2.jpg}}%
};
\node[white,anchor=north, yshift=-25mm](title) at (current page.north) {\HUGE\sffamily\uppercase{Data science project}};
\node[white,anchor=north, inner sep=5mm] at (title.south) {\LARGE\sffamily\uppercase{an inductive learning approach}};
\node[anchor=south west, inner sep=11mm] at (current page.south west) {\HUGE\sffamily\uppercase{F.A.N. Verri}};
\end{tikzpicture}
\end{titlingpage}
\newpage
\clearpage
\newpage
\frontmatter
\thispagestyle{empty}
\begin{tikzpicture}[remember picture, overlay]
\node[anchor=south east, inner sep=8mm] at (current page.south east) {%
\reflectbox{\includegraphics[height=0.3\paperheight]{images/toucan_bw.png}}%
};
\node[anchor=south west, inner sep=10mm] at (current page.south west)
{\large\sffamily Version 0.1 ``\textit{Audacious Hatchling}''};
% {\large\sffamily Version 1.0 ``\textit{Tropical Toucan}''};
\node[anchor=south east, inner sep=10mm] at (current page.south east) {\large\sffamily\today};
\node[anchor=north, yshift=-25mm](title) at (current page.north) {\HUGE\sffamily\uppercase{Data science project}};
\node[anchor=north, inner sep=5mm](subtitle) at (title.south) {\LARGE\sffamily\uppercase{an inductive learning approach}};
\node[anchor=north, inner sep=5mm] at (subtitle.south) {\Large\sffamily\uppercase{Filipe A. N. Verri}};
\end{tikzpicture}
\newpage
\mbox{}
\vfill
{
\footnotesize\noindent\color{red}
\textbf{Disclaimer:} This version is a work in progress. Proofreading and professional editing are
still pending.
}
\vspace{0.5cm}
{
\footnotesize\noindent
The book is typeset with \XeTeX{} using the Memoir class. All figures are
original and created with Ti\textit{k}Z. Proudly written in
\href{https://neovim.io/}{Neovim} with the assistance of
\href{https://github.com/features/copilot}{GitHub Copilot}.
Book cover image was created with the assistance of
\href{https://gemini.google.com}{Gemini} and \href{https://openai.com/dall-e-2}{DALL·E 2}.
We use the beautiful \href{https://www.stixfonts.org/}{STIX fonts} for text and math.
Some icons are from \href{https://fontawesome.com/}{Font Awesome 5} by Dave Gandy.
}
\vspace{0.5cm}
{
\footnotesize\noindent
Scripture quotations are from The ESV® Bible (The Holy Bible, English Standard Version®),
copyright © 2001 by Crossway, a publishing ministry of Good News Publishers. Used by
permission. All rights reserved.
}
\vspace{0.5cm}
{
\footnotesize\noindent
\thetitle{} © 2023--\the\year{} by \theauthor{}~\orcidlink{0000-0002-8240-5129} is licensed under
Attribution-NonCommercial-NoDerivatives 4.0 International. To view a copy of this license,
visit
\href{http://creativecommons.org/licenses/by-nc-nd/4.0/}{creativecommons.org/licenses/by-nc-nd/4.0}.
}
\thispagestyle{empty}
\newpage
\thispagestyle{empty}
% Dedication page
\begin{center}
\vspace{0.2\textheight}
\itshape
To my wife, for inspiring and supporting me to write this book.
\vfill
\raggedleft Above all, God be praised.
\end{center}
\newpage
\thispagestyle{empty}
\phantom{foo}
\newpage
\tableofcontents
\thispagestyle{empty}
\input{foreword}
\input{about}
% \input{courses}
\mainmatter
\input{history}
\input{data}
\input{project}
\input{structured}
\input{handling}
% \input{exploratory} TODO
\input{inductive}
\input{preprocess}
\input{planning}
% \input{ethics} TODO
\renewcommand{\theHchapter}{A\arabic{chapter}} % workaround for hyperref
\appendix
\input{preliminaries}
\input{machines}
\backmatter
\printbibliography
\printglossary
\end{document}