For this book, we assume that you have the following:
- A good understanding of programming in Python and machine/deep learning models
- Knowledge of how to use popular libraries, such as NumPy, pandas, and matplotlib
- Knowledge of basic statistics and quantitative finance
In this book, we attempt to give you a high-level overview of various techniques; however, we will focus on the practical applications of these methods. For a deeper dive into the theoretical foundations, we provide references for further reading.
The best way to learn anything is by doing. That is why we highly encourage you to experiment with the code samples provided (the code can be found in the accompanying GitHub repository), apply the techniques to different datasets, and explore possible extensions.
The code for this book was successfully run on a MacBook; however, it should work on any operating system. Additionally, you can always use online services such as Google Colab.
At the very beginning of each notebook (available on the book's GitHub repository), we run
a few cells that import and set up plotting with matplotlib. We will not mention this later on, as this would be repetitive, so at any time, assume that matplotlib is imported.
In the first cell, we first set up the backend of matplotlib to inline:
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
By doing so, each plotted figure will appear below the cell that generated it and the plot will also be visible in the Notebook should it be exported to another format (such as PDF or
HTML). The second line is used for MacBooks and displays the plot in higher resolution for
Retina displays.
The second cell appears as follows:
import matplotlib.pyplot as plt
import warnings
plt.style.use('seaborn')
plt.rcParams['figure.figsize'] = [16, 9]
plt.rcParams['figure.dpi'] = 300
warnings.simplefilter(action='ignore', category=FutureWarning)
In this cell, we import matplotlib and warnings, set up the style of the plots to
'seaborn' (this is a personal preference), as well as default plot settings, such as figure
size and resolution. We also disable (ignore) some warnings. In some chapters, we might
modify these settings for better readability of the figures (especially in black and white).