#### Overview of this book

Machine Learning for Finance explores new advances in machine learning and shows how they can be applied across the financial sector, including insurance, transactions, and lending. This book explains the concepts and algorithms behind the main machine learning techniques and provides example Python code for implementing the models yourself. The book is based on Jannes Klaas’ experience of running machine learning training courses for financial professionals. Rather than providing ready-made financial algorithms, the book focuses on advanced machine learning concepts and ideas that can be applied in a wide variety of ways. The book systematically explains how machine learning works on structured data, text, images, and time series. You'll cover generative adversarial learning, reinforcement learning, debugging, and launching machine learning products. Later chapters will discuss how to fight bias in machine learning. The book ends with an exploration of Bayesian inference and probabilistic programming.
Machine Learning for Finance
Contributors
Preface
Other Books You May Enjoy
Free Chapter
Applying Machine Learning to Structured Data
Utilizing Computer Vision
Understanding Time Series
Parsing Textual Data with Natural Language Processing
Using Generative Models
Reinforcement Learning for Financial Markets
Privacy, Debugging, and Launching Your Products
Fighting Bias
Bayesian Inference and Probabilistic Programming
Index

## Observational fairness

Equality is often seen as a purely qualitative issue, and as such, it's often dismissed by quantitative-minded modelers. As this section will show, equality can be seen from a quantitative perspective, too. Consider a classifier, c, with input X, some sensitive input, A, a target, Y and output C. Usually, we would denote the classifier output as , but for readability, we follow CS 294 and name it C.

Let's say that our classifier is being used to decide who gets a loan. When would we consider this classifier to be fair and free of bias? To answer this question, picture two demographics, group A and B, both loan applicants. Given a credit score, our classifier must find a cutoff point. Let's look at the distribution of applicants in this graph:

### Note

Note: The data for this example is synthetic; you can find the Excel file used for these calculations in the GitHub repository of this book, https://github.com/PacktPublishing/Machine-Learning-for-Finance/blob/master/9.1_parity...