Installation¶
Base Installation¶
ml4t-models keeps the base dependency set small. The default install gives you:
- typed batch and result contracts
- closed-form and NumPy-based model families
- pipeline composition utilities
- frame adapters that do not require heavy optional dependencies
Optional Extras¶
Neural Models¶
Install torch-backed models:
This extra is required for:
CAEModelSAEModelStochasticDiscountFactorModelLSTMPortfolioModelDeepPortfolioModel
Cross-Library Integration¶
Install tabular and spec helpers:
This extra is useful when you want:
ResultsFrame.to_polars()- parquet writing via
write_backtest_frames ml4t-specs-aware schema resolution
Documentation¶
Documentation tools are contributor dependencies. From a source checkout, install them with:
Everything¶
The all extra installs only user-facing runtime capabilities from deep and integration. It
does not install test, lint, type-check, or documentation tools.
Python Version¶
Stable releases support:
- Python 3.12
- Python 3.13
- Python 3.14
Python 3.15 prereleases run a separate compatibility gate. They are not part of the stable support range until the Python and dependency ecosystems publish compatible stable releases.
Development Setup¶
Using uv:
Run the quality gates:
uv run ruff check src/ tests/ examples/ scripts/
uv run ruff format --check src/ tests/ examples/ scripts/
uv run ty check
uv run pytest tests/ -q
uv build
Build the docs:
Related Libraries¶
ml4t-models is designed to integrate at boundaries with the rest of the ML4T stack:
ml4t-datafor dataset loading and canonical schema metadataml4t-engineerfor feature generation and labelsml4t-diagnosticfor IC, validation, and report generationml4t-backtestfor execution and backtest state transitions