Machine Learning for Finance
This is the code repository for Machine Learning for Finance, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.
About the book
Machine Learning for Finance explores new advances in machine learning and shows how they can be applied in the financial sector. It explains the concepts and algorithms behind the main machine learning techniques and provides example Python code for implementing the models yourself.
How to run this code
The code in this repository is quite compute heavy and best run on a GPU enabled machine. The datascience platform Kaggle offers free GPU recourses together with free online Jupyter notebooks. To make edits on the Kaggle notebooks, click 'Fork' to create a new copy of the notebook. You will need a Kaggle account for this.
Alternatively you can just view the notebooks on NB Viewer or download the code and run it locally.
Chapter 1 - A neural Network from Scratch
A neural network from Scratch & Intro to Keras: Run on Kaggle, View Online
Excercise excel sheet: Download
Chapter 2 - Structured Data
Credit card fraud detection: Run On Kaggle, View Online
Chapter 3 - Computer Vision Building Blocks
Classifying MNIST digits: Run On Kaggle, View Online
Chapter 4 - Practical Computer Vision
Classifying Plants: View Online, Run On Colab
Intro to Python Generators: Run On Kaggle
Keras Generator with Logistic Regression: Run On Kaggle
Stacking VGG: Run On Kaggle
Preprocessing and Saving VGG Outputs: Run On Kaggle
Rule Based Preprocessing and Augmentation: Run On Kaggle
Visualizing ConvNets: Run On Kaggle
Chapter 5 - Time Series
Forecasting Web Traffic: Classic Methods: Run On Kaggle, View Online
Forecasting Web Traffic: Time Series Neural Nets: Run On Kaggle, View Online
Expressing Uncertainty with Bayesian Deep Learning: Run On Kaggle, View Online
Chapter 6 - Natural Language processing
Analyzing the News: Run On Kaggle, View Online
Classifying Tweets: Run On Kaggle, View Online
Topic modeling with LDA: Run On Kaggle, View Online
Sequence to Sequence models: Run On Kaggle, View Online
Chapter 7 - Generative Models
(Variational) Autoencoder for MNIST: Run On Kaggle, View Online
(Variational) Autoencoder for Fraud Detection: Run On Kaggle, View Online
MNIST DCGAN: Run On Kaggle, View Online
Semi Supervised Generative Adversarial Network for Fraud Detection: Run On Kaggle, View Online
Chapter 8 - Reinforcement Learning
Q-Learning: View Online
A2C Pole Balancing: View Online
A2C for Trading: Run On Kaggle View Online
Chapter 9 - Debugging ML Systems
Unit Testing Data: Run On Kaggle, View Online
Hyperparameter Optimization: View Online
Learning Rate Search: View Online
Using Tensorboard: View Online
Converting Keras Models to TF Estimators: View Online
Faster Python with Cython: Download Part 1, Download Part 2
Chapter 10 - Fighting Bias in Machine Learning
Understanding Parity in Excel: Download
Learning How to Pivot: View Online
Interpretability with SHAP: View Online