When your trading strategy needs more than a hunch
Over 150 Jupyter notebooks that translate an 800-page guide on machine learning for trading into executable experiments, from linear regression to deep reinforcement learning.

What it does
This repository is the code companion to Packt’s Machine Learning for Algorithmic Trading, Second Edition. It houses more than 150 notebooks demonstrating how to source market and alternative data, engineer financial features, train predictive models, and backtest strategies across equities, ETFs, and even satellite imagery.
The interesting bit
The notebooks treat machine learning as a single station in an end-to-end workflow rather than a standalone prediction contest. They use a customized version of Zipline to inject model predictions directly into trading simulations, and the second edition replicates several recent academic papers—including CNNs that convert time series to images for return prediction and GANs that synthesize training data.
Key highlights
- Covers the full spectrum from linear regression and random forests to deep reinforcement learning and NLP for sentiment analysis
- Replicates recent journal research, including Sezer and Ozbahoglu (2018), Gu et al. (2019), and Yoon et al. (2019)
- Expands beyond daily US equities to international stocks, ETFs, minute-frequency intraday data, and alternative sources like SEC filings
- Adds a dedicated chapter on strategy backtesting and an appendix with over 100 alpha factors
- Built on
pandas 1.0andTensorFlow 2.2(at time of writing), with a tailoredZiplineintegration for strategy design
Caveats
- The notebooks assume you have the book nearby; they reference concepts and extra detail that did not fit the printed page
- Dependency versions such as
pandas 1.0andTensorFlow 2.2reflect the publication date - Several datasets require separate download and preprocessing before the notebooks will run
Verdict
A solid starting point for data scientists or developers entering quantitative finance who want a structured, opinionated curriculum. Less useful if you are hunting for a production-ready, standalone trading framework.
Frequently asked
- What is PacktPublishing/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original?
- Over 150 Jupyter notebooks that translate an 800-page guide on machine learning for trading into executable experiments, from linear regression to deep reinforcement learning.
- Is Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original open source?
- Yes — PacktPublishing/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original is open source, released under the MIT license.
- What language is Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original written in?
- PacktPublishing/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original is primarily written in Jupyter Notebook.
- How popular is Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original?
- PacktPublishing/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original has 1.6k stars on GitHub.
- Where can I find Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original?
- PacktPublishing/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original is on GitHub at https://github.com/PacktPublishing/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original.