machine-learning-for-trading

(★ 20,566)

Code for Machine Learning for Trading, 3rd edition — from data sourcing to live execution.

  • .env.example
  • .gitignore
  • .pre-commit-config.yaml
  • .verified-notebooks.tsv
  • docker-compose.yml
  • LICENSE
  • matplotlibrc
  • pyproject.toml
  • README.md
  • sitecustomize.py
  • uv.lock

# Installation Guide

1. Get the code
git clone https://github.com/stefan-jansen/machine-learning-for-trading

Downloads the entire project code from GitHub to your computer.

cd machine-learning-for-trading

Moves into the project folder you just downloaded.

2. Official Install Script

Easy Recommended
curl -LsSf https://astral.sh/uv/install.sh | sh

Downloads and runs the official install script in one line — this handles the full setup automatically.

After installing, open a new terminal and run the program's version command (e.g. --version) to confirm it worked.

Pulled directly from this repo's README.

3. Docker

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker compose pull ml4t # Option A — Docker (recommended)

Runs the command against the services defined in the compose file.

docker compose up -d ml4t # Docker: same address

Builds and starts all defined containers (server, database, etc.) at once, in the background.

├── docker-compose.yml all Docker services

Runs the command against the services defined in the compose file.

Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

Pulled directly from this repo's README.

4. Python

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Python 3 On Windows, be sure to check 'Add Python to PATH' during installation.
ML4T_DATA_PATH="${ML4T_DATA_PATH:-$PWD/data}" uv run jupyter lab # local: open the URL it prints

Type this command into your terminal and run it.

If it runs without errors and prints output in the terminal, it worked.

Pulled directly from this repo's README.

// repository documentation