#1414th of 88 in Learning and cookbooksFor finance and business, trading, stocks and crypto, finance and accounting
machine-learning-for-trading
Code for the book on ML trading strategies, with nine case studies
- Stars
- 21.8k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Sep 2026
- Language
- Jupyter Notebook
16,921 on 21 Apr 202621,784 on 10 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
Companion code for Stefan Jansen's Machine Learning for Trading, 3rd edition: 27 chapter directories of Jupyter notebooks covering data, features, models, backtesting, costs, risk and live trading. Nine case studies (ETFs, crypto perps, options, FX, futures, equities) run through the same pipeline. Models range from ridge and gradient boosting to PatchTST, RL and RAG over SEC filings.
Who it is for: Quant researchers and engineers learning to build and test ML trading strategies
Strengths
- 27 chapter guides map book sections to notebooks and list the data each needs
- Nine case studies apply one pipeline across ETFs, crypto, options, FX and futures
- Covers overfitting controls: walk-forward CV, Deflated Sharpe Ratio, White's Reality Check
- Second edition kept intact on the second-edition branch
Weaknesses
- Written to accompany a paid book; the book carries no code listings
- Some case studies need real compute or licensed data, per the README
- Wide dependency stack (Polars, PyTorch, Optuna and more) makes setup heavy
- README embeds course and workshop promotion that changes daily
What it needs
- Compose
- Needs Docker, Interactive Brokers, Alpaca, QuantConnect
- Models: XGBoost, LightGBM, CatBoost, PyTorch
Quick answers
Is machine-learning-for-trading open source?
Yes. Its code is on GitHub under the MIT license.
Can you run machine-learning-for-trading with Docker?
Yes. Its repository has a Docker setup: a Dockerfile, a Compose file or a published image.
Also in Learning and cookbooks
See all 88| Rank | Project | Score |
|---|---|---|
| 1 | ai-engineering-from-scratchHands-on AI engineering curriculum with 542 lessons across 20 phases | 91 out of 100 |
| 2 | generative-ai-for-beginners21-lesson course on building generative AI apps in Python and TypeScript | 83 out of 100 |
| 3 | rag_techniquesCollection of 42 runnable notebooks implementing RAG techniques | 81 out of 100 |
| #4 | cs249r_bookOpen textbook and course materials for machine learning systems engineering | 81 out of 100 |
| #5 | ai-for-beginners24-lesson AI curriculum with notebooks in PyTorch and TensorFlow | 80 out of 100 |