Space-Apps-Project

AI-assisted: this folder was developed with the help of Claude (Anthropic) at the request of a project contributor. See ../AI_DISCLOSURE.md.

Fire-risk model (weekly hotspot probability per 0.1° cell)

Predicts, for every ~11 km cell in northern Chihuahua, the probability of at least one hotspot in the next 7, 14 or 28 days. Data: NASA FIRMS only (the harmonized MODIS + VIIRS series from ../harmonization, rows with in_calendar = 1). No weather, vegetation or other sources are used.

Run

cd risk_model_weekly
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
# ../harmonization/harmonized_hotspots.csv is already in the repo (or rebuild it, see ../harmonization/README.md)
.venv/bin/python -m pytest -q tests                      # leakage / label / grid tests
.venv/bin/python run.py                                  # all horizons + 7-day backtest (~1.5 min)
.venv/bin/python run.py --horizons 7 --no-backtest

Settings (cell size, horizons, split dates, model parameters) are in config.yaml.

Method

Test results (2023-01 to 2026-07, ~0.7% of cell-weeks burn at 7 days)

| Horizon | Model | PR-AUC | Brier | Top-5% cells capture | |—|—|—|—|—| | 7 days | LightGBM | 0.118 | 0.00628 | 47.0% | | | cell climatology (B1) | 0.070 | 0.00657 | 36.6% | | | persistence (B2) | 0.044 | 0.00654 | 22.9% | | 14 days | LightGBM | 0.157 | 0.01122 | 41.2% | | | cell climatology (B1) | 0.115 | 0.01179 | 35.6% | | 28 days | LightGBM | 0.207 | 0.01978 | 37.0% | | | cell climatology (B1) | 0.176 | 0.02065 | 35.1% |

“Top-5% capture” = share of the week’s burning cells that fall in the 5% of cells ranked highest (random would be 5%). The 7-day model beats climatology in all 18 backtest years (2009-2026) on PR-AUC and capture.

Outputs (outputs/h7, h14, h28)

forecast_<date>.csv / .geojson (probability per cell for the week after the last data, with the climatology probability and the ratio), top25_risk.csv, test_predictions.parquet, metrics.json, test_by_month.csv, backtest_by_year.csv (7 d), feature_importance.csv, summary.png, lgbm.txt (model). In git: metrics, figures, feature importance, the 7-day forecast, the models and test_predictions.parquet. The calibrators (calibrators.pkl) are not stored (a pickle can run code when loaded); run.py regenerates them.

Limits

How it differs from ../ml

../ml predicts the next 72 h on a 0.25 degree grid using weather, NDVI and altitude. This model predicts the next 7, 14 or 28 days on a 0.1 degree grid from FIRMS hotspot history only. They are separate and are not connected to the backend or the web app.