work on model training

This commit is contained in:
2026-03-05 11:03:20 +11:00
parent 96e72d7c43
commit c8e38cd597
10 changed files with 534 additions and 30 deletions

View File

@@ -40,6 +40,7 @@ pip install -r scripts/requirements.txt
- `scripts/train_rain_model.py`: strict time-based split training and metrics report.
- `scripts/predict_rain_model.py`: inference using saved model artifact; upserts into
`predictions_rain_1h`.
- `scripts/run_rain_ml_worker.py`: long-running worker for periodic training + prediction.
## Usage
### 1) Apply schema update (existing DBs)
@@ -90,6 +91,18 @@ export DATABASE_URL="postgres://postgres:postgres@localhost:5432/micrometeo?sslm
bash scripts/run_p0_rain_workflow.sh
```
### 6) Continuous training + prediction via Docker Compose
The `rainml` service in `docker-compose.yml` now runs:
- periodic retraining (default every 24 hours)
- periodic prediction writes (default every 10 minutes)
Artifacts are persisted to `./models` on the host.
```sh
docker compose up -d rainml
docker compose logs -f rainml
```
## Output
- Audit report: `models/rain_data_audit.json`
- Training report: `models/rain_model_report.json`