-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (72 loc) · 3.02 KB
/
Copy pathMakefile
File metadata and controls
94 lines (72 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# ---------------------------------------------------------------------------
# ML-Quant-Trading — convenience make targets
# ---------------------------------------------------------------------------
PY ?= python
PIP ?= $(PY) -m pip
PYTEST ?= $(PY) -m pytest
RUFF ?= $(PY) -m ruff
CONFIG ?= configs/small.yaml
.PHONY: help install install-dev lint format test cov benchmark technical-audit public-validation aggregate-validation audit-validation \
demo gen-data features train portfolio backtest \
paper clean clean-all
help:
@echo "Targets:"
@echo " install pip install -e ."
@echo " install-dev pip install -e .[dev]"
@echo " lint ruff check ."
@echo " format ruff format ."
@echo " test pytest"
@echo " cov pytest with coverage"
@echo " benchmark benchmark tensor factor primitives"
@echo " technical-audit verify factor, mask, label, timing, and cost invariants"
@echo " public-validation run public-data validation benchmark"
@echo " aggregate-validation aggregate public-data validation reports"
@echo " audit-validation audit a public-data validation report"
@echo " demo run the complete synthetic pipeline"
@echo " gen-data synthesise GBM-based OCHLV panel (CONFIG=$(CONFIG))"
@echo " features compute factor matrix"
@echo " train train ML model"
@echo " portfolio run cross-sectional Markowitz optimisation"
@echo " backtest run vectorised backtest + metrics"
@echo " paper end-to-end pipeline (small config)"
@echo " clean remove caches and build artefacts"
install:
$(PIP) install -e .
install-dev:
$(PIP) install -e .[dev]
lint:
$(RUFF) check src tests scripts
format:
$(RUFF) format src tests
test:
$(PYTEST)
cov:
$(PYTEST) --cov=mlquant --cov-report=term-missing
benchmark:
$(PY) scripts/benchmark_tensor_factors.py --device cpu --n-dates 750 --n-stocks 1000 --window 20 --repeat 10 --warmup 3 --threads 1 --interop-threads 1 --seed 42 --json-out artifacts/benchmark-v1.json
technical-audit:
$(PY) scripts/technical_pipeline_audit.py
public-validation:
$(PY) scripts/public_data_validation.py --source synthetic --models equal_weight,momentum_20,alpha101_mean
aggregate-validation:
$(PY) scripts/aggregate_validation_reports.py artifacts/public_data_validation
audit-validation:
$(PY) scripts/audit_validation_report.py artifacts/public_data_validation/summary.json
demo:
$(PY) -m mlquant.cli.main demo --config $(CONFIG)
gen-data:
$(PY) -m mlquant.cli.main gen-data --config $(CONFIG)
features:
$(PY) -m mlquant.cli.main features --config $(CONFIG)
train:
$(PY) -m mlquant.cli.main train --config $(CONFIG)
portfolio:
$(PY) -m mlquant.cli.main portfolio --config $(CONFIG)
backtest:
$(PY) -m mlquant.cli.main backtest --config $(CONFIG)
paper: demo
clean:
rm -rf .pytest_cache .ruff_cache .mypy_cache build dist *.egg-info
find . -type d -name __pycache__ -prune -exec rm -rf {} +
clean-all: clean
rm -rf artifacts checkpoints data/processed data/interim