Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning for Finance

You're reading from   Machine Learning for Finance Principles and practice for financial insiders

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789136364
Length 456 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Jannes Klaas Jannes Klaas
Author Profile Icon Jannes Klaas
Jannes Klaas
James Le James Le
Author Profile Icon James Le
James Le
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Machine Learning for Finance
Contributors
Preface
Other Books You May Enjoy
1. Neural Networks and Gradient-Based Optimization 2. Applying Machine Learning to Structured Data FREE CHAPTER 3. Utilizing Computer Vision 4. Understanding Time Series 5. Parsing Textual Data with Natural Language Processing 6. Using Generative Models 7. Reinforcement Learning for Financial Markets 8. Privacy, Debugging, and Launching Your Products 9. Fighting Bias 10. Bayesian Inference and Probabilistic Programming Index

Optimizing model parameters

We've already seen that we need to tweak the weights and biases, collectively called the parameters, of our model in order to arrive at a closer approximation of our desired function.

In other words, we need to look through the space of possible functions that can be represented by our model in order to find a function, Optimizing model parameters, that matches our desired function, f, as closely as possible.

But how would we know how close we are? In fact, since we don't know f, we cannot directly know how close our hypothesis, Optimizing model parameters, is to f. But what we can do is measure how well Optimizing model parameters's outputs match the output of f. The expected outputs of f given X are the labels, y. So, we can try to approximate f by finding a function, Optimizing model parameters, whose outputs are also y given X.

We know that the following is true:

Optimizing model parameters

We also know that:

Optimizing model parameters

We can try to find f by optimizing using the following formula:

Optimizing model parameters

Within this formula, Optimizing model parameters is the space of functions that can be represented by our model, also called the hypothesis space, while D is the distance function, which we use to evaluate how close Optimizing model parameters and y are.

Note

Note: This approach makes a crucial assumption that our data, X, and labels, y, represent our desired function, f. This is not always the case. When our data contains systematic biases, we might gain a function that fits our data well but is different from the one we wanted.

An example of optimizing model parameters comes from human resource management. Imagine you are trying to build a model that predicts the likelihood of a debtor defaulting on their loan, with the intention of using this to decide who should get a loan.

As training data, you can use loan decisions made by human bank managers over the years. However, this presents a problem as these managers might be biased. For instance, minorities, such as black people, have historically had a harder time getting a loan.

With that being said, if we used that training data, our function would also present that bias. You'd end up with a function mirroring or even amplifying human biases, rather than creating a function that is good at predicting who is a good debtor.

It is a commonly made mistake to believe that a neural network will find the intuitive function that we are looking for. It'll actually find the function that best fits the data with no regard for whether that is the desired function or not.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image