Datasets:
Upload folder using huggingface_hub
Browse files- README.md +124 -0
- data/wildfire_forest_clearing_burn.csv +0 -0
- data/wildfire_savanna_fire_belt.csv +0 -0
- data/wildfire_urban_peri_urban_haze.csv +0 -0
- generate_dataset.py +224 -0
- requirements.txt +3 -0
- validate_dataset.py +122 -0
- validation_report.png +3 -0
README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- tabular-classification
|
| 5 |
+
- tabular-regression
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- climate-health
|
| 10 |
+
- wildfire
|
| 11 |
+
- smoke
|
| 12 |
+
- pm2-5
|
| 13 |
+
- respiratory
|
| 14 |
+
- synthetic
|
| 15 |
+
- sub-saharan-africa
|
| 16 |
+
pretty_name: Wildfire Smoke & Respiratory Outcomes (SSA)
|
| 17 |
+
size_categories:
|
| 18 |
+
- 10K<n<100K
|
| 19 |
+
configs:
|
| 20 |
+
- config_name: savanna_fire_belt
|
| 21 |
+
data_files: data/wildfire_savanna_fire_belt.csv
|
| 22 |
+
- config_name: forest_clearing_burn
|
| 23 |
+
data_files: data/wildfire_forest_clearing_burn.csv
|
| 24 |
+
default: true
|
| 25 |
+
- config_name: urban_peri_urban_haze
|
| 26 |
+
data_files: data/wildfire_urban_peri_urban_haze.csv
|
| 27 |
+
---
|
| 28 |
+
|
| 29 |
+
# Wildfire Smoke & Respiratory Outcomes in Sub-Saharan Africa
|
| 30 |
+
|
| 31 |
+
## Abstract
|
| 32 |
+
|
| 33 |
+
A synthetic dataset modelling wildfire smoke exposure and respiratory health outcomes across three fire regime scenarios in sub-Saharan Africa. Each record represents an individual-month observation describing smoke PM2.5 exposure, fire proximity, vulnerability, respiratory symptoms, and health service utilisation. Africa accounts for over 70% of global burned area annually, with savanna fires in West/Central Africa and agricultural clearing burns in the Congo Basin driving massive seasonal smoke plumes.
|
| 34 |
+
|
| 35 |
+
### Scenarios
|
| 36 |
+
|
| 37 |
+
- **Savanna Fire Belt**: West/Central African savanna fires (Nov-Mar) with widespread seasonal haze.
|
| 38 |
+
- **Forest Clearing Burn**: Congo Basin agricultural/forest clearing fires (Jun-Sep) with intense localised smoke.
|
| 39 |
+
- **Urban Peri-Urban Haze**: Cities downwind of fire zones with combined ambient + smoke pollution.
|
| 40 |
+
|
| 41 |
+
## Dataset Structure
|
| 42 |
+
|
| 43 |
+
Each scenario contains 10,000 records (30,000 total). Key columns:
|
| 44 |
+
|
| 45 |
+
- `year`, `month`, `in_fire_season`, `age`, `sex`, `setting`
|
| 46 |
+
- `is_child_u5`, `is_elderly_60plus`, `pre_existing_asthma`, `pre_existing_copd`, `smoker`
|
| 47 |
+
- `pm25_smoke_ugm3`, `pm25_total_ugm3`, `aqi_category`
|
| 48 |
+
- `fire_proximity_km`, `smoke_days_per_season`, `fire_count`
|
| 49 |
+
- `mask_use`, `stayed_indoors`, `vulnerability_index`, `exposure_risk_score`
|
| 50 |
+
- `cough`, `wheeze`, `dyspnoea`, `eye_irritation`
|
| 51 |
+
- `ari_episode`, `asthma_exacerbation`, `copd_exacerbation`
|
| 52 |
+
- `er_visit`, `hospitalised`, `mortality`, `climate_fire_trend`
|
| 53 |
+
|
| 54 |
+
## Parameterization Evidence
|
| 55 |
+
|
| 56 |
+
| Parameter | Value Used | Source | Year |
|
| 57 |
+
| --- | --- | --- | --- |
|
| 58 |
+
| Africa >70% of global burned area | Fire frequency baseline | GFEDv4, van der Werf et al. | 2017 |
|
| 59 |
+
| Savanna fire PM2.5 100-300 µg/m³ during fire season | Smoke exposure | Roberts et al., Atmos Chem Phys | 2009 |
|
| 60 |
+
| Forest clearing fires produce denser, localised plumes | Clearing scenario | Reddington et al. | 2015 |
|
| 61 |
+
| PM2.5 exposure increases ARI risk 1.5-3x | Dose-response | WHO AQG | 2021 |
|
| 62 |
+
|
| 63 |
+
## Validation Summary
|
| 64 |
+
|
| 65 |
+
The 8-panel validation report (`validation_report.png`) confirms:
|
| 66 |
+
|
| 67 |
+
1. **PM2.5 gradient**: Forest clearing has highest smoke PM2.5; urban haze adds ambient baseline.
|
| 68 |
+
2. **Seasonality**: Clear monthly PM2.5 peaks during fire season months per scenario.
|
| 69 |
+
3. **Symptoms**: Cough and eye irritation dominate; rates highest in forest clearing.
|
| 70 |
+
4. **Exposure-ARI**: Higher exposure risk scores correlate with more ARI episodes.
|
| 71 |
+
5. **Vulnerability**: Children <5 and elderly have highest vulnerability indices.
|
| 72 |
+
6. **Health cascade**: ARI > ER visits > hospitalisation > mortality gradient realistic.
|
| 73 |
+
7. **AQI**: Forest clearing has most "hazardous" days; urban haze more "unhealthy" days.
|
| 74 |
+
8. **Fire proximity**: Closer fires produce higher smoke PM2.5 during fire season.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
|
| 78 |
+
## Usage
|
| 79 |
+
|
| 80 |
+
```python
|
| 81 |
+
from datasets import load_dataset
|
| 82 |
+
|
| 83 |
+
ds = load_dataset("electricsheepafrica/wildfire-smoke-respiratory", name="forest_clearing_burn")
|
| 84 |
+
df = ds["train"].to_pandas()
|
| 85 |
+
|
| 86 |
+
# Fire season vs non-fire season ARI rates
|
| 87 |
+
print(df.groupby("in_fire_season")["ari_episode"].mean())
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
## Intended Uses
|
| 91 |
+
|
| 92 |
+
- Modelling wildfire smoke health impacts in SSA
|
| 93 |
+
- Evaluating respiratory burden during fire seasons
|
| 94 |
+
- Training exposure-response models for smoke-related respiratory outcomes
|
| 95 |
+
|
| 96 |
+
## Limitations
|
| 97 |
+
|
| 98 |
+
- **Synthetic data**: Not from air quality monitoring networks or clinical records.
|
| 99 |
+
- **Simplified fire model**: Fire proximity and PM2.5 modeled independently.
|
| 100 |
+
- **No spatial geocoding**: Scenarios proxy geography, not precise coordinates.
|
| 101 |
+
- **Mask efficacy**: Modeled as binary; real-world compliance varies.
|
| 102 |
+
|
| 103 |
+
## References
|
| 104 |
+
|
| 105 |
+
1. van der Werf GR, et al. Global fire emissions estimates during 1997-2016. *Earth Syst Sci Data*, 2017;9:697-720.
|
| 106 |
+
2. Roberts G, et al. African biomass burning emissions. *Atmos Chem Phys*, 2009.
|
| 107 |
+
3. Reddington CL, et al. Air quality and health impacts of vegetation fires. *Nat Geosci*, 2015.
|
| 108 |
+
4. WHO. Global Air Quality Guidelines. WHO, 2021.
|
| 109 |
+
|
| 110 |
+
## Citation
|
| 111 |
+
|
| 112 |
+
```bibtex
|
| 113 |
+
@dataset{electricsheepafrica_wildfire_smoke_respiratory_2025,
|
| 114 |
+
title={Wildfire Smoke and Respiratory Outcomes in Sub-Saharan Africa},
|
| 115 |
+
author={Electric Sheep Africa},
|
| 116 |
+
year={2025},
|
| 117 |
+
publisher={HuggingFace},
|
| 118 |
+
url={https://huggingface.co/datasets/electricsheepafrica/wildfire-smoke-respiratory}
|
| 119 |
+
}
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
## License
|
| 123 |
+
|
| 124 |
+
CC-BY-4.0
|
data/wildfire_forest_clearing_burn.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/wildfire_savanna_fire_belt.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/wildfire_urban_peri_urban_haze.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
generate_dataset.py
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Generate synthetic wildfire smoke & respiratory outcomes dataset for SSA."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
+
import numpy as np
|
| 8 |
+
import pandas as pd
|
| 9 |
+
|
| 10 |
+
SEED = 42
|
| 11 |
+
N_PER_SCENARIO = 10_000
|
| 12 |
+
|
| 13 |
+
YEAR_RANGE = np.arange(2010, 2025)
|
| 14 |
+
YEAR_WEIGHTS = np.linspace(0.85, 1.3, len(YEAR_RANGE))
|
| 15 |
+
YEAR_WEIGHTS = YEAR_WEIGHTS / YEAR_WEIGHTS.sum()
|
| 16 |
+
|
| 17 |
+
SCENARIOS = {
|
| 18 |
+
"savanna_fire_belt": {
|
| 19 |
+
"fire_season_months": [11, 12, 1, 2, 3],
|
| 20 |
+
"pm25_smoke_mean": 180,
|
| 21 |
+
"pm25_smoke_sd": 90,
|
| 22 |
+
"pm25_baseline": 25,
|
| 23 |
+
"fire_frequency_mean": 3.5,
|
| 24 |
+
"fire_proximity_km_mean": 12,
|
| 25 |
+
"fire_proximity_km_sd": 8,
|
| 26 |
+
"smoke_days_mean": 45,
|
| 27 |
+
"smoke_days_sd": 18,
|
| 28 |
+
"asthma_prev": 0.08,
|
| 29 |
+
"copd_prev": 0.04,
|
| 30 |
+
"ari_rate_per1k": 85,
|
| 31 |
+
"er_visit_rate": 0.12,
|
| 32 |
+
"mortality_rate_per100k": 4.5,
|
| 33 |
+
"setting_probs": {"rural": 0.60, "peri_urban": 0.25, "urban": 0.15},
|
| 34 |
+
"mask_access": 0.05,
|
| 35 |
+
},
|
| 36 |
+
"forest_clearing_burn": {
|
| 37 |
+
"fire_season_months": [6, 7, 8, 9],
|
| 38 |
+
"pm25_smoke_mean": 250,
|
| 39 |
+
"pm25_smoke_sd": 120,
|
| 40 |
+
"pm25_baseline": 20,
|
| 41 |
+
"fire_frequency_mean": 2.0,
|
| 42 |
+
"fire_proximity_km_mean": 8,
|
| 43 |
+
"fire_proximity_km_sd": 5,
|
| 44 |
+
"smoke_days_mean": 60,
|
| 45 |
+
"smoke_days_sd": 25,
|
| 46 |
+
"asthma_prev": 0.07,
|
| 47 |
+
"copd_prev": 0.03,
|
| 48 |
+
"ari_rate_per1k": 95,
|
| 49 |
+
"er_visit_rate": 0.10,
|
| 50 |
+
"mortality_rate_per100k": 5.0,
|
| 51 |
+
"setting_probs": {"rural": 0.70, "peri_urban": 0.20, "urban": 0.10},
|
| 52 |
+
"mask_access": 0.03,
|
| 53 |
+
},
|
| 54 |
+
"urban_peri_urban_haze": {
|
| 55 |
+
"fire_season_months": [12, 1, 2, 3],
|
| 56 |
+
"pm25_smoke_mean": 120,
|
| 57 |
+
"pm25_smoke_sd": 55,
|
| 58 |
+
"pm25_baseline": 40,
|
| 59 |
+
"fire_frequency_mean": 1.5,
|
| 60 |
+
"fire_proximity_km_mean": 25,
|
| 61 |
+
"fire_proximity_km_sd": 15,
|
| 62 |
+
"smoke_days_mean": 30,
|
| 63 |
+
"smoke_days_sd": 12,
|
| 64 |
+
"asthma_prev": 0.10,
|
| 65 |
+
"copd_prev": 0.05,
|
| 66 |
+
"ari_rate_per1k": 70,
|
| 67 |
+
"er_visit_rate": 0.18,
|
| 68 |
+
"mortality_rate_per100k": 3.5,
|
| 69 |
+
"setting_probs": {"urban": 0.50, "peri_urban": 0.35, "rural": 0.15},
|
| 70 |
+
"mask_access": 0.15,
|
| 71 |
+
},
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
SCENARIO_FILES = {
|
| 75 |
+
"savanna_fire_belt": "wildfire_savanna_fire_belt.csv",
|
| 76 |
+
"forest_clearing_burn": "wildfire_forest_clearing_burn.csv",
|
| 77 |
+
"urban_peri_urban_haze": "wildfire_urban_peri_urban_haze.csv",
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def _choice(rng, prob_map):
|
| 82 |
+
keys = list(prob_map.keys())
|
| 83 |
+
weights = np.array(list(prob_map.values()), dtype=float)
|
| 84 |
+
weights = weights / weights.sum()
|
| 85 |
+
return rng.choice(keys, p=weights)
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
def _simulate_scenario(name, params, seed):
|
| 89 |
+
rng = np.random.default_rng(seed)
|
| 90 |
+
records = []
|
| 91 |
+
|
| 92 |
+
for idx in range(N_PER_SCENARIO):
|
| 93 |
+
year = int(rng.choice(YEAR_RANGE, p=YEAR_WEIGHTS))
|
| 94 |
+
age = int(np.clip(rng.normal(32, 18), 1, 85))
|
| 95 |
+
sex = rng.choice(["male", "female"], p=[0.48, 0.52])
|
| 96 |
+
setting = _choice(rng, params["setting_probs"])
|
| 97 |
+
is_child = int(age < 5)
|
| 98 |
+
is_elderly = int(age >= 60)
|
| 99 |
+
|
| 100 |
+
pre_existing_asthma = int(rng.random() < params["asthma_prev"])
|
| 101 |
+
pre_existing_copd = int(age > 35 and rng.random() < params["copd_prev"])
|
| 102 |
+
smoker = int(age > 15 and rng.random() < 0.12)
|
| 103 |
+
|
| 104 |
+
month = int(rng.choice(range(1, 13)))
|
| 105 |
+
in_fire_season = int(month in params["fire_season_months"])
|
| 106 |
+
|
| 107 |
+
if in_fire_season:
|
| 108 |
+
pm25_smoke = float(np.clip(rng.normal(params["pm25_smoke_mean"], params["pm25_smoke_sd"]), 20, 800))
|
| 109 |
+
else:
|
| 110 |
+
pm25_smoke = float(np.clip(rng.normal(params["pm25_baseline"], 10), 5, 60))
|
| 111 |
+
|
| 112 |
+
pm25_total = float(pm25_smoke + rng.normal(params["pm25_baseline"], 8))
|
| 113 |
+
pm25_total = float(np.clip(pm25_total, 10, 900))
|
| 114 |
+
|
| 115 |
+
fire_proximity_km = float(np.clip(
|
| 116 |
+
rng.normal(params["fire_proximity_km_mean"], params["fire_proximity_km_sd"]), 0.5, 100
|
| 117 |
+
))
|
| 118 |
+
|
| 119 |
+
smoke_days = int(np.clip(
|
| 120 |
+
rng.normal(params["smoke_days_mean"], params["smoke_days_sd"]) * (1.2 if in_fire_season else 0.3),
|
| 121 |
+
0, 120,
|
| 122 |
+
))
|
| 123 |
+
|
| 124 |
+
fire_count = int(np.clip(rng.poisson(params["fire_frequency_mean"]), 0, 15))
|
| 125 |
+
|
| 126 |
+
aqi_category = (
|
| 127 |
+
"hazardous" if pm25_total > 250 else
|
| 128 |
+
"very_unhealthy" if pm25_total > 150 else
|
| 129 |
+
"unhealthy" if pm25_total > 55 else
|
| 130 |
+
"moderate" if pm25_total > 35 else
|
| 131 |
+
"good"
|
| 132 |
+
)
|
| 133 |
+
|
| 134 |
+
mask_use = int(rng.random() < params["mask_access"] * (1.5 if in_fire_season else 0.5))
|
| 135 |
+
stayed_indoors = int(in_fire_season and rng.random() < 0.20)
|
| 136 |
+
|
| 137 |
+
vulnerability = (
|
| 138 |
+
0.15
|
| 139 |
+
+ is_child * 0.25
|
| 140 |
+
+ is_elderly * 0.20
|
| 141 |
+
+ pre_existing_asthma * 0.15
|
| 142 |
+
+ pre_existing_copd * 0.15
|
| 143 |
+
+ smoker * 0.10
|
| 144 |
+
)
|
| 145 |
+
vulnerability = float(np.clip(vulnerability, 0, 1))
|
| 146 |
+
|
| 147 |
+
exposure_risk = float(np.clip(
|
| 148 |
+
(pm25_total / 300) * (1 - mask_use * 0.3) * (1 - stayed_indoors * 0.4) * vulnerability * 2,
|
| 149 |
+
0, 1,
|
| 150 |
+
))
|
| 151 |
+
|
| 152 |
+
cough = int(rng.random() < 0.15 + exposure_risk * 0.35)
|
| 153 |
+
wheeze = int(rng.random() < 0.08 + exposure_risk * 0.25)
|
| 154 |
+
dyspnoea = int(rng.random() < 0.05 + exposure_risk * 0.20)
|
| 155 |
+
eye_irritation = int(in_fire_season and rng.random() < 0.20 + exposure_risk * 0.25)
|
| 156 |
+
|
| 157 |
+
ari_episode = int(rng.random() < params["ari_rate_per1k"] / 1000 * (1 + exposure_risk * 2))
|
| 158 |
+
asthma_exacerbation = int(pre_existing_asthma and rng.random() < 0.15 + exposure_risk * 0.3)
|
| 159 |
+
copd_exacerbation = int(pre_existing_copd and rng.random() < 0.10 + exposure_risk * 0.25)
|
| 160 |
+
|
| 161 |
+
er_visit = int(
|
| 162 |
+
(ari_episode or asthma_exacerbation or copd_exacerbation)
|
| 163 |
+
and rng.random() < params["er_visit_rate"]
|
| 164 |
+
)
|
| 165 |
+
hospitalised = int(er_visit and rng.random() < 0.25)
|
| 166 |
+
|
| 167 |
+
mortality = int(
|
| 168 |
+
hospitalised and rng.random() < params["mortality_rate_per100k"] / 100_000 * 500
|
| 169 |
+
)
|
| 170 |
+
|
| 171 |
+
climate_fire_trend = float(np.clip(0.015 * (year - 2010) + rng.normal(0, 0.005), -0.02, 0.1))
|
| 172 |
+
|
| 173 |
+
record = {
|
| 174 |
+
"record_id": f"{name[:3].upper()}-{idx:05d}",
|
| 175 |
+
"scenario": name,
|
| 176 |
+
"year": year,
|
| 177 |
+
"month": month,
|
| 178 |
+
"in_fire_season": in_fire_season,
|
| 179 |
+
"age": age,
|
| 180 |
+
"sex": sex,
|
| 181 |
+
"setting": setting,
|
| 182 |
+
"is_child_u5": is_child,
|
| 183 |
+
"is_elderly_60plus": is_elderly,
|
| 184 |
+
"pre_existing_asthma": pre_existing_asthma,
|
| 185 |
+
"pre_existing_copd": pre_existing_copd,
|
| 186 |
+
"smoker": smoker,
|
| 187 |
+
"pm25_smoke_ugm3": round(pm25_smoke, 1),
|
| 188 |
+
"pm25_total_ugm3": round(pm25_total, 1),
|
| 189 |
+
"aqi_category": aqi_category,
|
| 190 |
+
"fire_proximity_km": round(fire_proximity_km, 1),
|
| 191 |
+
"smoke_days_per_season": smoke_days,
|
| 192 |
+
"fire_count": fire_count,
|
| 193 |
+
"mask_use": mask_use,
|
| 194 |
+
"stayed_indoors": stayed_indoors,
|
| 195 |
+
"vulnerability_index": round(vulnerability, 2),
|
| 196 |
+
"exposure_risk_score": round(exposure_risk, 3),
|
| 197 |
+
"cough": cough,
|
| 198 |
+
"wheeze": wheeze,
|
| 199 |
+
"dyspnoea": dyspnoea,
|
| 200 |
+
"eye_irritation": eye_irritation,
|
| 201 |
+
"ari_episode": ari_episode,
|
| 202 |
+
"asthma_exacerbation": asthma_exacerbation,
|
| 203 |
+
"copd_exacerbation": copd_exacerbation,
|
| 204 |
+
"er_visit": er_visit,
|
| 205 |
+
"hospitalised": hospitalised,
|
| 206 |
+
"mortality": mortality,
|
| 207 |
+
"climate_fire_trend": round(climate_fire_trend, 4),
|
| 208 |
+
}
|
| 209 |
+
records.append(record)
|
| 210 |
+
|
| 211 |
+
return pd.DataFrame(records)
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
def main():
|
| 215 |
+
output_dir = Path("data")
|
| 216 |
+
output_dir.mkdir(parents=True, exist_ok=True)
|
| 217 |
+
for idx, (name, params) in enumerate(SCENARIOS.items()):
|
| 218 |
+
df = _simulate_scenario(name, params, SEED + idx * 211)
|
| 219 |
+
df.to_csv(output_dir / SCENARIO_FILES[name], index=False)
|
| 220 |
+
print(f"Saved {name} -> {SCENARIO_FILES[name]}")
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
if __name__ == "__main__":
|
| 224 |
+
main()
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
numpy>=1.24
|
| 2 |
+
pandas>=2.0
|
| 3 |
+
matplotlib>=3.7
|
validate_dataset.py
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Validate synthetic wildfire smoke & respiratory outcomes dataset."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
+
import matplotlib.pyplot as plt
|
| 8 |
+
import pandas as pd
|
| 9 |
+
|
| 10 |
+
SCENARIO_FILES = {
|
| 11 |
+
"savanna_fire_belt": "wildfire_savanna_fire_belt.csv",
|
| 12 |
+
"forest_clearing_burn": "wildfire_forest_clearing_burn.csv",
|
| 13 |
+
"urban_peri_urban_haze": "wildfire_urban_peri_urban_haze.csv",
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
COLORS = {
|
| 17 |
+
"savanna_fire_belt": "#e6550d",
|
| 18 |
+
"forest_clearing_burn": "#31a354",
|
| 19 |
+
"urban_peri_urban_haze": "#756bb1",
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def load_data() -> pd.DataFrame:
|
| 24 |
+
frames = []
|
| 25 |
+
for scenario, filename in SCENARIO_FILES.items():
|
| 26 |
+
df = pd.read_csv(Path("data") / filename)
|
| 27 |
+
frames.append(df)
|
| 28 |
+
return pd.concat(frames, ignore_index=True)
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def plot_validation(df: pd.DataFrame, output_path: Path) -> None:
|
| 32 |
+
fig, axes = plt.subplots(4, 2, figsize=(14, 16))
|
| 33 |
+
axes = axes.flatten()
|
| 34 |
+
|
| 35 |
+
# Panel 1: PM2.5 total by scenario
|
| 36 |
+
for s in SCENARIO_FILES:
|
| 37 |
+
subset = df[df["scenario"] == s]
|
| 38 |
+
axes[0].hist(subset["pm25_total_ugm3"], bins=40, alpha=0.5, color=COLORS[s], label=s)
|
| 39 |
+
axes[0].set_title("PM2.5 Total Distribution by Scenario")
|
| 40 |
+
axes[0].set_xlabel("PM2.5 (µg/m³)")
|
| 41 |
+
axes[0].legend(fontsize=7)
|
| 42 |
+
|
| 43 |
+
# Panel 2: Seasonality - PM2.5 by month
|
| 44 |
+
for s in SCENARIO_FILES:
|
| 45 |
+
subset = df[df["scenario"] == s]
|
| 46 |
+
monthly = subset.groupby("month")["pm25_total_ugm3"].mean()
|
| 47 |
+
axes[1].plot(monthly.index, monthly.values, marker="o", color=COLORS[s], label=s)
|
| 48 |
+
axes[1].set_title("Monthly PM2.5 Trend")
|
| 49 |
+
axes[1].set_xlabel("Month")
|
| 50 |
+
axes[1].set_ylabel("Mean PM2.5")
|
| 51 |
+
axes[1].legend(fontsize=7)
|
| 52 |
+
|
| 53 |
+
# Panel 3: Respiratory symptoms by scenario
|
| 54 |
+
symptom_cols = ["cough", "wheeze", "dyspnoea", "eye_irritation"]
|
| 55 |
+
symptom_rates = df.groupby("scenario")[symptom_cols].mean() * 100
|
| 56 |
+
symptom_rates.plot(kind="bar", ax=axes[2])
|
| 57 |
+
axes[2].set_title("Respiratory Symptom Prevalence (%)")
|
| 58 |
+
axes[2].set_ylabel("Percent")
|
| 59 |
+
axes[2].legend(fontsize=7)
|
| 60 |
+
|
| 61 |
+
# Panel 4: Exposure risk vs ARI
|
| 62 |
+
for s in SCENARIO_FILES:
|
| 63 |
+
subset = df[df["scenario"] == s]
|
| 64 |
+
axes[3].scatter(
|
| 65 |
+
subset["exposure_risk_score"], subset["ari_episode"],
|
| 66 |
+
s=6, alpha=0.1, color=COLORS[s], label=s,
|
| 67 |
+
)
|
| 68 |
+
axes[3].set_title("Exposure Risk Score vs ARI Episode")
|
| 69 |
+
axes[3].set_xlabel("Exposure risk score")
|
| 70 |
+
axes[3].set_ylabel("ARI episode")
|
| 71 |
+
axes[3].legend(fontsize=7)
|
| 72 |
+
|
| 73 |
+
# Panel 5: Vulnerability index distribution
|
| 74 |
+
for s in SCENARIO_FILES:
|
| 75 |
+
subset = df[df["scenario"] == s]
|
| 76 |
+
axes[4].hist(subset["vulnerability_index"], bins=20, alpha=0.5, color=COLORS[s], label=s)
|
| 77 |
+
axes[4].set_title("Vulnerability Index Distribution")
|
| 78 |
+
axes[4].set_xlabel("Vulnerability index")
|
| 79 |
+
axes[4].legend(fontsize=7)
|
| 80 |
+
|
| 81 |
+
# Panel 6: Health outcomes cascade
|
| 82 |
+
cascade_cols = ["ari_episode", "er_visit", "hospitalised", "mortality"]
|
| 83 |
+
cascade = df.groupby("scenario")[cascade_cols].mean() * 100
|
| 84 |
+
cascade.plot(kind="bar", ax=axes[5])
|
| 85 |
+
axes[5].set_title("Health Outcomes Cascade (%)")
|
| 86 |
+
axes[5].set_ylabel("Percent")
|
| 87 |
+
axes[5].legend(fontsize=7)
|
| 88 |
+
|
| 89 |
+
# Panel 7: AQI category distribution
|
| 90 |
+
aqi_counts = df.groupby(["scenario", "aqi_category"]).size().groupby(level=0).apply(lambda s: s / s.sum())
|
| 91 |
+
aqi_counts.unstack().plot(kind="bar", stacked=True, ax=axes[6])
|
| 92 |
+
axes[6].set_title("AQI Category Distribution")
|
| 93 |
+
axes[6].set_ylabel("Share")
|
| 94 |
+
axes[6].legend(fontsize=6)
|
| 95 |
+
|
| 96 |
+
# Panel 8: Fire proximity vs PM2.5
|
| 97 |
+
fire_season = df[df["in_fire_season"] == 1]
|
| 98 |
+
for s in SCENARIO_FILES:
|
| 99 |
+
subset = fire_season[fire_season["scenario"] == s]
|
| 100 |
+
axes[7].scatter(
|
| 101 |
+
subset["fire_proximity_km"], subset["pm25_smoke_ugm3"],
|
| 102 |
+
s=6, alpha=0.15, color=COLORS[s], label=s,
|
| 103 |
+
)
|
| 104 |
+
axes[7].set_title("Fire Proximity vs Smoke PM2.5 (fire season)")
|
| 105 |
+
axes[7].set_xlabel("Fire proximity (km)")
|
| 106 |
+
axes[7].set_ylabel("PM2.5 smoke (µg/m³)")
|
| 107 |
+
axes[7].legend(fontsize=7)
|
| 108 |
+
|
| 109 |
+
plt.tight_layout()
|
| 110 |
+
fig.savefig(output_path, dpi=200)
|
| 111 |
+
plt.close(fig)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
def main() -> None:
|
| 115 |
+
df = load_data()
|
| 116 |
+
output_path = Path("validation_report.png")
|
| 117 |
+
plot_validation(df, output_path)
|
| 118 |
+
print(f"Saved {output_path}")
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
if __name__ == "__main__":
|
| 122 |
+
main()
|
validation_report.png
ADDED
|
Git LFS Details
|