feat: complete ML pipeline, FastAPI service, small model, tests, image

- finish the global HistGB bundle, scenario forecasts and 28-day ablation
- export sensors/series/forecasts/metrics/context plus baked weather frames
- add FastAPI health/meta/predict/simulate and background /train jobs
- add the p75 busy classifier, retraining from CSV, and hot-swap persistence
- add pytest coverage, multi-stage non-root Dockerfile, README and model card

Holdout: weather 7d MAE 3.32 / WAPE 27.5% / R2 0.777 vs seasonal naive
MAE 4.23 / WAPE 35.0% / R2 0.656 (5,350 eval rows).
This commit is contained in:
Noel Sabia committed 2026-11-14 05:01:16 +01:00
1 parent 68402803b2
commit 939a8db482
43 files changed
+4090 -105

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
UV ?= uv
.PHONY: help data train test serve docker clean
help:
@printf '%s\n' \
'make data parse/clean the raw CSV, join weather + holidays, export JSON' \
'make train fit the 28-day holdout model, export metrics/forecasts/model' \
'make test run pytest' \
'make serve run the FastAPI service on :8000' \
'make docker build the multi-stage image (pulsecast-ml:local)' \
'make clean remove caches and generated artifacts (keeps data/raw)'
data:
$(UV) run python -m pulsecast.pipeline
train:
$(UV) run python -m pulsecast.train
test:
$(UV) run pytest
serve:
$(UV) run uvicorn pulsecast.server:app --host 0.0.0.0 --port 8000
docker:
docker build -t pulsecast-ml:local .
clean:
rm -rf data/cache artifacts .pytest_cache
find . -type d -name __pycache__ -prune -exec rm -rf {} +