Skip to content

Pre-computed case study artifacts (v3.0)

Latest

Choose a tag to compare

@stefan-jansen stefan-jansen released this 24 Jul 08:08
3df1293

Pre-computed case study artifacts (v3.0)

Tag: v3.0.0-artifacts · Repo: stefan-jansen/machine-learning-for-trading

Model predictions, fitted models, backtests and the full metrics registry for all nine case
studies in Machine Learning for Trading, 3rd Edition. Download these to explore the book's
results immediately instead of spending days retraining.

uv run python scripts/download_artifacts.py            # all nine (~3.1 GB)
uv run python scripts/download_artifacts.py --cs etfs  # just one
uv run python scripts/download_artifacts.py --list     # what's available

Each case study is a separate asset, so you only download what you want. Start with etfs
(33 MB)
- it is the case study the book follows most closely.

Contents

Asset Size Prediction sets Training runs Backtests
etfs.tar.gz 33 MB 10 7 55
cme_futures.tar.gz 37 MB 21 13 56
fx_pairs.tar.gz 41 MB 17 16 50
sp500_options.tar.gz 42 MB 9 8 26
crypto_perps_funding.tar.gz 43 MB 12 11 66
sp500_equity_option_analytics.tar.gz 44 MB 16 16 52
us_firm_characteristics.tar.gz 56 MB 14 13 46
nasdaq100_microstructure.tar.gz 1.1 GB 12 11 43
us_equities_panel.tar.gz 1.6 GB 16 15 69

The last two are large because they are wide, high-frequency panels - a single NASDAQ minute-bar
prediction set is about 80 MB on its own. Their artifact counts are in line with the rest.

Each asset extracts to case_studies/{id}/run_log/:

  • registry.db - the complete metrics catalog, not a subset. Every training run, prediction
    set, backtest, IC, Sharpe, drawdown and cohort metric the pipeline recorded stays queryable,
    including lineages whose parquet files are not shipped.
  • predictions/ - the carrier the book's narrative follows, the sealed holdout set, and the
    best set per model family and label.
  • training/ - the fitted models behind those predictions: coefficients, boosters, fold
    metrics, learning curves.
  • backtest/ - the carrier's full chain (its cost surface and risk overlay), every holdout
    backtest, and the top few per stage by Sharpe, each with daily returns and weights.
  • .release/ - provenance: SOURCE_COMMIT, per-file SHA256SUMS, accepted_registry.tsv
    (integrity and foreign-key state of the shipped registry), artifact_coverage.tsv, and
    SELECTION.json naming the exact hashes selected.

The registry is a plain SQLite file - open it with any SQLite client, or use the helpers in
case_studies/utils/.

Using them

The analysis stages run straight off the registry, no training required:

uv run python case_studies/etfs/13_model_analysis.py     # cross-family comparison (Ch11-15)
uv run python case_studies/etfs/18_strategy_analysis.py  # IC, Sharpe, costs, holdout (Ch20)

Your own runs register alongside the shipped ones rather than replacing them, so retrain any
stage and the analysis notebooks will show your result next to the book's.

What is not included

The full backtest sweeps - roughly 40 GB of run logs across the nine case studies, up to ~2,500
backtests for a single one. What ships is the lineage the book discusses plus a few alternatives
per stage. Re-run any backtest stage to generate the rest.

These artifacts do not replace the raw data. Notebooks that build features or train models still
need the datasets from data/download_all.py; the artifacts let you skip retraining, not
downloading.

Verification

sha256sum -c SHA256SUMS
Asset SHA-256
cme_futures.tar.gz ab1c97276cdf74aa95d894cc0b0f3ea909c3ed8356f41f217e008c971e34b4f8
crypto_perps_funding.tar.gz 517030f3def6d0264984c2b545032741100df4ee3d159e44ef4c348a314c4c7f
etfs.tar.gz 93d3e24dcb4872b965f355a6931f163e0871a58729c1bd1ea6d99f369f2baf39
fx_pairs.tar.gz 0555a5b2788576ba9eeb8fd874f5375a651d5094b2952eb42aa01aac4bee38e6
nasdaq100_microstructure.tar.gz a688081f30f97b2ab9f7f926e0608734ed4145ecfd1bf189624709d694c2167f
sp500_equity_option_analytics.tar.gz 4eba2aadcc1fc5af322f0cfb0a8d4dcfb036391141adff59a0358c2a8401ca49
sp500_options.tar.gz 55333f313d3a2180a468e326030aa80d713b271c85d41d55989532f9567fccb2
us_equities_panel.tar.gz ebf5b0b846da310e2611126b0059e5c51f116e185f82d47248f81cf088f32e27
us_firm_characteristics.tar.gz 2ec2087a054e1a075f7baa51546a2453c0d7db6108211e9cfbb80f95d894cffb