mrkeyoor.com_
Tue 01 Sept 17:44 UTC
Dataevaluationupdated 28 Aug 2026

machine-learning-for-trading review

Machine Learning for Trading is the code and notebook companion to Stefan Jansen's third-edition book on researching, testing, and operating machine-learning trading strategies. It covers the path from market data and feature design through backtesting, costs, risk, and live deployment.

+35 / 3dstars / 7d
Verdict

Our install consumed 10,031 MB, pip-audit found 12 known vulnerabilities, and the tests were still at 12 percent when our 900-second limit expired. Use Machine Learning for Trading as a serious course repository when you want its end-to-end research discipline and can isolate the environment. Do not make it the base of a small production service or treat its notebooks as a shortcut to a deployable strategy.

We ran it

Lab card: what happened when we ran machine-learning-for-tradingScreenshot of machine-learning-for-trading (ml4trading.io)
Install✓ · 275s523 packages · 10031 MB
Build✓ · 8s
Tests✗ timed out · 900sran, no count parsed
Known vulns12(pip-audit)
Repo1723 files~533,709 lines of source · 279.2 MB · 6 CI workflows · tests dir

Answers from our run

Does machine-learning-for-trading build from source?

Dependencies installed in 275 seconds (523 packages), and the build succeeded in 8 seconds. We cloned commit 701fcc7 into a clean Debian container with 3 CPUs and no project-specific setup.

Do machine-learning-for-trading's tests pass?

We could not finish them: the suite was still running after 15 minutes in our container.

Does machine-learning-for-trading have known vulnerabilities in its dependencies?

pip-audit flagged 12 known advisories in the dependency tree at the time of our run.

Who should not use machine-learning-for-trading?

Developers who need a small dependency footprint: our installation pulled 523 packages and occupied 10,031 MB.

What are the alternatives to machine-learning-for-trading?

Qlib, vectorbt, Zipline. Our install consumed 10,031 MB, pip-audit found 12 known vulnerabilities, and the tests were still at 12 percent when our 900-second limit expired.

Setup2/510,031 MB install with several platform-specific paths
Docs5/5Detailed setup, platform, data, and notebook guidance
Community5/520,708 stars with same-day pushes and issue work
Maturity4/5Deep curriculum, but tests timed out and audit found 12 advisories

Who it’s for

Python users studying quantitative research with enough disk, memory, and time for a large environment.
Practitioners who want examples spanning data engineering, model validation, backtesting, costs, and risk.
Book readers who want the code, case studies, precomputed artifacts, and chapter notebooks together.
Researchers who value explicit controls for leakage, multiple testing, and holdout evaluation.

Who it’s NOT for

Developers who need a small dependency footprint: our installation pulled 523 packages and occupied 10,031 MB.
Teams requiring a clean security audit before use: pip-audit reported 12 known vulnerabilities in our installed environment.
Anyone expecting a short CI-style test run: our suite reached only 12 percent before the 900-second cap.
Native Windows Python or Intel Mac users who refuse Docker: the installation guide says those local paths are unsupported.
Readers who want every notebook under one interpreter: several notebooks require the separate Python 3.12 image, while the main environment follows Python 3.14.
Traders looking for a ready-made profitable strategy: the material teaches research and operational controls, and its examples do not promise future returns.

Setup reality

Our sandbox installed 523 packages in 275 seconds and used 10,031 MB on disk. The build succeeded in 8 seconds. Tests timed out after 900 seconds at 12 percent progress; the log showed continuing passes and skips, with no final suite result. Pip-audit reported 12 known vulnerabilities.

The recommended path uses prebuilt Docker Compose services and an .env file. Local setup needs uv, Python 3.14, a C/C++ compiler, Python headers, and platform-specific libraries. Data-provider credentials are optional until a chapter requests them.

Native Windows Python and local Intel macOS are unsupported; Windows uses WSL2, while Intel Macs need Docker. Some notebooks use separate Python 3.12 images, database benchmarks need extra services, and NVIDIA acceleration needs Linux or WSL2 plus the container toolkit.

The third edition teaches one research-to-production process

This repository follows a 27-chapter book rather than presenting a single Python library. The sequence begins with data and research design, moves through features and model families, then reaches simulation, portfolio construction, costs, risk, deployment, and monitoring. Nine case studies apply that process to ETFs, crypto perpetuals, intraday equities, options, foreign exchange, futures, and wider equity panels. The repeated workflow is more useful than a folder of unrelated finance demos.

The methodological stance is the strongest reason to use it. The README separates exploratory tuning from confirmation, uses walk-forward validation, and discusses multiple-testing controls, transaction costs, uncertainty, and strategy retirement. Those topics stop a learner from treating a high backtest score as sufficient evidence. The repository also includes agent-oriented tasks with stated defenses against lookahead bias and leakage. It still cannot supply judgment about whether a market assumption is credible.

Six libraries turn the book into a working stack

The notebooks use six related Python packages for data, feature engineering, models, diagnostics, backtesting, and live operation. That gives readers shared interfaces across the chapters instead of a new miniature framework in every notebook. The model coverage is wide, including linear baselines, gradient boosting, deep time-series models, latent factors, causal methods, reinforcement learning, and language-model work grounded in financial documents.

Breadth has a price. Our environment ended with 523 packages and 10,031 MB before downloading the datasets a reader may need. Some chapters use separate services or runtimes because their libraries do not coexist on the main interpreter. This is reasonable for a book spanning market databases, deep learning, econometrics, and broker integration. It is a poor dependency base for an application that only needs one backtester or one factor model.

What happened when we ran it

Our sandbox installed commit 701fcc7 in 275 seconds, adding 523 packages and occupying 10,031 MB on disk. The build succeeded in 8 seconds. The checkout already held 1,723 files, about 533,709 lines of source, and 279.2 MB. We ran it in a fresh unprivileged Debian container with 3 CPUs, 8 GB of RAM, Python 3.12, and no secrets.

The test command did not finish within 900 seconds. At the timeout, pytest had reached 12 percent and was continuing through causal and case-study files. The visible tail showed passing dots and many skipped case-study entries, but there was no final summary. A partial stream is not a passed suite, and the log gives no basis for predicting how long the remaining work would take.

Pip-audit reported 12 known vulnerabilities in the installed environment. The supplied result does not include severity or package names, so the defensible finding stops there. The repository has 6 CI workflow files, a compose file, and a tests directory, but no Dockerfile in the checkout. Those signals show substantial engineering machinery without cancelling our timeout or audit result.

Docker reduces platform friction, not resource use

The installation guide recommends Docker Compose with prebuilt images. The main service opens Jupyter Lab, while other profiles cover Python 3.12-only notebooks, storage databases, and GPU work. Local uv installation is narrower: it needs a C/C++ compiler and Python headers because several locked packages build from source. macOS also needs an OpenMP runtime for LightGBM.

Windows users are directed into WSL2, and native Windows Python is unsupported. Intel Mac users need Docker because the required PyTorch wheel is unavailable for local installation. Apple Silicon can use the local uv path, although a subset of notebooks runs through an emulated Python 3.12 container. NVIDIA acceleration belongs on Linux or WSL2 with the appropriate driver and container setup. A class or team should standardize one supported path before troubleshooting notebooks individually.

Data access and provenance remain part of the lesson

The quick start copies .env.example before launching the main service. Defaults are enough to begin, while specific datasets may later require credentials or downloads. Storage benchmarks also start database containers. A notebook can therefore fail because code, environment, external data, registry state, or a service is missing. The repository's installation verifier is worth running before attributing a chapter error to the research itself.

Open issue 558 reports that NASDAQ-100 minute-bar conversion did not create the expected output directory inside Docker. Issue 593 reports a ModuleNotFoundError for scripts when running an ETF case-study command. Issue 614 is even more specific: an FX model path can reference an earlier population that a clean clone does not have, causing failure before fitting. These reports are citable warnings that a large teaching stack still has clean-machine edges.

August 2026 activity outweighs the unfinished run

GitHub recorded 20,708 stars, 9 combined issues and pull requests, and a last push on August 28, 2026. The latest release, v3.0.0-artifacts, was published on July 24 with precomputed case-study artifacts. Current pull requests discuss notebook provenance, corrected selection logic, holdout boundaries, and executed case-study stages. That is active technical work, and the combined open count is not a bug count.

The repository is best approached as a demanding lab course. Keep it in an isolated environment, audit the 12 reported advisories before trusting any network-facing component, and budget more than our 900-second window for verification. Readers who work through the data lineage, evidence boundary, costs, and risk controls will learn more than they would from a thin prediction notebook. Anyone who only needs a backtest API should choose a narrower project and avoid carrying 10,031 MB of curriculum into production.

Alternatives

ProjectWhat it isPick it when
Qlib gh↗A research platform for quantitative investment workflows and model experiments.pick this instead when you want a reusable research framework more than a book-organized curriculum.
vectorbtA Python library for fast vectorized strategy analysis and backtesting.pick this instead when rapid strategy sweeps matter more than the full data-to-production syllabus.
ZiplineAn event-driven Python backtesting library with a long history in algorithmic trading.pick this instead when you need a narrower backtesting engine and can accept an archived upstream repository.

What people are saying

  1. [velocity-scout] stefan-jansen/machine-learning-for-trading

Sources

  1. Machine Learning for Trading repository and README
  2. Installation guide
  3. Precomputed case-study artifacts release
  4. Missing scripts import report
  5. NASDAQ-100 data preparation report
  6. Clean-clone FX population failure

More data reviews

turso · TrackersListCollection · dash · getcontact-cli · awesome-zhuiju-free · iggy · the whole board →