mrkeyoor.comAsk

stefan-jansen/machine-learning-for-tradingtested 09 Nov 2026commit 91c903e

machine-learning-for-trading review

Our Machine Learning for Trading environment installed in 360 seconds, occupied 10,277 MB and hit the 900-second test cap.

  • Build 13 s
  • Tests timed out
360 sto install
  • 527 packages
Dataevaluationupdated 13 Nov 2026
+95stars / 7d

Machine Learning for Trading is Stefan Jansen's companion code for a book about researching and operating machine-learning trading strategies. It connects data preparation and model evaluation to portfolio decisions, costs and live-system topics through notebooks and case studies.

Verdict

Our Machine Learning for Trading environment installed in 360 seconds, occupied 10,277 MB and hit the 900-second test cap. Use it to work through the research process if you can support that environment and investigate the 16 audit findings. Choose a dedicated engine if you only need to implement an already defined strategy.

We ran it

Lab card: what happened when we ran machine-learning-for-trading
Lab card from our sandbox run
Screenshot of machine-learning-for-trading (ml4trading.io)
ml4trading.io
Install✓ · 360s527 packages · 10277 MB
Build✓ · 13s
Tests✗ timed out · 900sran, no count parsed
Known vulns16(pip-audit)
Repo2065 files~675,471 lines of source · 189.7 MB · 9 CI workflows · tests dir

Answers from our run

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

Dependencies installed in 360 seconds (527 packages), and the build succeeded in 13 seconds. We cloned commit 91c903e 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 16 known advisories in the dependency tree at the time of our run.

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

Second-edition readers using the default branch: the README directs that edition to the second-edition branch.

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

Backtesting.py, LEAN. Our Machine Learning for Trading environment installed in 360 seconds, occupied 10,277 MB and hit the 900-second test cap.

Setup3/5Our source checkout installed in 360 s and built in 13 s, a heavy install of 527 dependencies, and we did not run a README task.Editor’s note: The sandbox install and build completed, but supported-platform setup and a notebook workflow were not confirmed.
Docs3/5The README has an install section (“Quick Start”) and usage in the same section, but the usage section is thin: no code and under 400 characters.Editor’s note: The README was read, but its chapter and platform instructions were not executed for a documentation quality rating.
Community5/5Last push on 2026-11-13 and 21,818 stars.Editor’s note: One automated data-monitoring issue was read; support responsiveness and user adoption were not assessed.
Maturity4/5Latest release v3.1.0-artifacts on 2026-09-20, repository created 2018-05-09 and its test suite timed out in our sandbox.Editor’s note: The suite timed out and no live trading or production reliability workload was evaluated.

How we score

Who it’s for

Python users working through the third edition and willing to follow a case study across chapters.
Researchers who want to study validation, transaction costs and risk alongside prediction models.

Who it’s NOT for

Second-edition readers using the default branch: the README directs that edition to the second-edition branch.
Developers requiring native Windows Python: the documented Windows route requires WSL2.
Teams seeking only an execution engine: this repository organizes book chapters and research case studies.
Anyone assuming the MIT code license also covers the book and supplied AlgoSeek data: the README separates those rights.

Setup reality

Our November 9, 2026 sandbox run at 91c903e installed successfully in 360 seconds and built in 13 seconds. It recorded 527 dependencies and 10,277 MB on disk. Tests timed out at 900 seconds with progress at 21% in the supplied tail. pip-audit reported 16 known vulnerabilities.

The README offers Docker or local uv, directs Windows users to WSL2, and requires a compiler and Python headers for the local route. Free datasets need no API keys; other datasets have provider-specific access requirements. Local notebooks need an absolute ML4T_DATA_PATH.

The recorded configuration was 3 CPUs, 8 GB RAM and image ghcr.io/astral-sh/uv:python3.12-bookworm. The label does not establish actual runtime versions. The test tail gives no cause for the timeout, and the audit total gives no package-level diagnosis.

Learn the research process before connecting a broker

Machine Learning for Trading gives you chapter code and connected case studies for learning how a prediction becomes a trading decision. Pick it if you want to examine data availability, validation, portfolio construction and costs together. Someone who already has a strategy and only needs an execution engine should start elsewhere.

The current README follows the third edition, with 27 chapters and nine case studies. Second-edition readers need the second-edition branch. That detail matters more than the long model list: following an older book against today's default branch means looking for material in the wrong place.

What happened when we ran it

Our sandbox installed the recorded environment in 360 seconds and built it in 13 seconds, but the test command timed out at 900 seconds. The run used commit 91c903e on November 9, 2026.

Recorded step Result What it tells you
Install Succeeded in 360 s 527 dependencies recorded, 10,277 MB on disk
Build Succeeded in 13 s The recorded build step completed
Tests Timed out in 900 s No completed suite result
pip-audit 16 known vulnerabilities Dependency remediation needs investigation

The last supplied test lines show progress through 20% and 21%, with passing markers across scan projection, allocator, Compose and conformal-calibration checks. One line includes a skipped marker. Output stops during tests/test_conftest_autouse_fixtures.py. That tail identifies where reporting stopped, not the cause of the timeout. It supplies neither a final pass count nor a failing assertion.

The checkout was 189.7 MB across 2,065 files, with approximately 675,471 source lines. The scan recorded nine CI workflow files, Compose and a tests directory, but no Dockerfile. Today's README documents Docker environments under envs/; the scan result should not be read as proof that container support is absent.

The configured sandbox had 3 CPUs and 8 GB RAM, using image label ghcr.io/astral-sh/uv:python3.12-bookworm. That label does not establish the actual Python or operating-system version. The disk figure makes the immediate decision easier: reserve space for a substantial research environment before adding datasets.

The notebooks connect modeling to costs and risk

The README's chapter map carries predictions into simulation, portfolio construction, transaction costs and risk management. This is the main reason to choose the material over collecting isolated model examples. A better prediction score is only one input to a strategy that must survive execution costs.

Walk-forward validation and controls for repeated experimentation get explicit coverage. Those are documented teaching topics, not a certification that every example avoids leakage. Follow one case study through the workflow and examine its data dates and evaluation split before changing models. Otherwise, the repository's breadth can turn into a lot of notebooks opened without a research question answered.

Platform and data choices come before the first notebook

The README offers Docker and a local uv environment, with compiler and Python-header requirements for the local route. It directs Windows users to WSL2 and says native Windows Python is unsupported. Its platform table sends Intel Mac users to Docker because the local PyTorch dependency path cannot resolve there.

Free dataset downloads need no API keys, while the data guide covers provider credentials and storage tiers. Start with those free datasets before committing to a case study that needs licensed inputs. The README also offers precomputed artifacts for exploring results without retraining, which is a useful reading route when the experiment itself exceeds your machine.

For local notebooks, the README sets ML4T_DATA_PATH to an absolute path because notebooks run from their chapter folders. A missing-data message can therefore call for checking the configured path before downloading the same files again. Keep the tokenized Jupyter URL private. The documented Docker route opens Jupyter without a token, so check exposure before putting it on a reachable server.

External data can change after code has shipped

Issue #1160 records an automated external-data failure for cot_cftc. Its description says the upstream provider appeared to have changed a location or payload. A follow-up reports a passing weekly run and closes the issue. That is a reported recovery, not a diagnosis we reproduced.

The repository's last push was November 13, 2026; the latest release endpoint returned v3.1.0-artifacts, published September 20. Recent push activity and the closed monitoring thread support ongoing maintenance. Neither establishes response times for a reader's problem or the accuracy of downloaded financial data. A release tag's age alone would miss that distinction.

Backtesting.py and LEAN answer narrower implementation needs

Backtesting.py documents Python strategy backtesting. Choose it when your immediate question is how a defined strategy behaves on historical bars, rather than how to work through a curriculum. LEAN documents backtesting and live trading through its CLI and algorithm engine. Choose it when an operational trading engine is the deliverable. These are differences in purpose, not measured speed comparisons.

The code here carries an MIT license, but the README reserves rights to the book content and separately identifies AlgoSeek data rights. Check the relevant asset's terms before redistributing a notebook's supporting material. The code license does not settle dataset permission.

What we have not tested yet

We have not reproduced a complete notebook pipeline, broker connection, profitable strategy, GPU workload or alternative installation route. The audit total does not identify affected packages or exploitability, and the supplied test tail cannot explain the timeout. Community research was not collected. The public README and issue thread supplement a build/test sandbox run, not a trading-system evaluation.

All score dimensions are unassessed: this review has no numerical rating rubric, supported-platform installation confirmation, documentation execution audit, support study or production reliability run. Start with the chapter and free dataset that match your question, complete that workflow, then decide whether the broader environment earns its disk space.

Alternatives

ProjectWhat it isPick it when
Backtesting.pyPython strategy backtesting with a documented Strategy and Backtest API.Choose this when you have a strategy to simulate and want a backtesting library.
LEAN gh↗An algorithmic trading engine with backtesting and live-trading workflows.Choose this when the deliverable is an operational trading engine rather than a book curriculum.

Sources

  1. Project README
  2. External-data issue and recovery
  3. Backtesting.py README
  4. LEAN README

More data reviews