sanvicpatel's picture
Upload reproducible Protostar climate forecasts
993d9a6 verified
|
Raw History Blame Contribute Delete
1.48 kB
# Code and reproduction
From the dataset root, use Python 3.12 or later:
```sh
python -m venv .venv
. .venv/bin/activate
pip install -r code/requirements.txt
python code/forecast.py
python code/check_local.py submission.csv
```
`forecast.py` verifies the curated input hashes, blocks network access, fits the models named in `ensemble.json` using observations through 2018, and writes all 5,880 forecasts. `check_local.py` checks the same required keys and finite-value rules as the template checker using the audited local city list. `check_submission.py` is the original official checker; it reads the city list from Hugging Face. The blank template provides row order only.
`inputs.py` loads and checks every dated input before filtering. `models.py`, `ocean.py`, `advanced.py`, `climate.py`, `direct.py` and `teleconnection.py` contain the candidate forecast families. `experiments.py` constructs the score mask and the 30-year baseline. `selection.py` fits nonnegative metric-specific weights on historical predictions. Data acquisition lives in the `download*.py` scripts; their weather requests are limited to pinned cutoff data and explicitly bounded NOAA requests. See `AGENTS.md` for the agent boundary.
To rerun model selection, generate all common folds using `./code/backtest.sh`. This is slower than reproducing the frozen forecast and writes intermediate prediction arrays under `reports/`. The compact `reports/validation.json` is included with the submission.