Datasets:
Upload folder using huggingface_hub
Browse files- README.md +136 -0
- data/indoor_air_clean_fuel_transition.csv +0 -0
- data/indoor_air_improved_stove_rollout.csv +0 -0
- data/indoor_air_traditional_biomass.csv +0 -0
- generate_dataset.py +311 -0
- requirements.txt +3 -0
- validate_dataset.py +135 -0
- validation_report.png +3 -0
README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- tabular-regression
|
| 5 |
+
- tabular-classification
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- climate-health
|
| 10 |
+
- household-air-pollution
|
| 11 |
+
- clean-cooking
|
| 12 |
+
- pm2-5
|
| 13 |
+
- cookstoves
|
| 14 |
+
- pneumonia
|
| 15 |
+
- synthetic
|
| 16 |
+
- sub-saharan-africa
|
| 17 |
+
pretty_name: Indoor Air Pollution & Clean Cooking (SSA)
|
| 18 |
+
size_categories:
|
| 19 |
+
- 10K<n<100K
|
| 20 |
+
configs:
|
| 21 |
+
- config_name: traditional_biomass
|
| 22 |
+
data_files: data/indoor_air_traditional_biomass.csv
|
| 23 |
+
- config_name: improved_stove_rollout
|
| 24 |
+
data_files: data/indoor_air_improved_stove_rollout.csv
|
| 25 |
+
default: true
|
| 26 |
+
- config_name: clean_fuel_transition
|
| 27 |
+
data_files: data/indoor_air_clean_fuel_transition.csv
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
# Indoor Air Pollution & Clean Cooking in Sub-Saharan Africa
|
| 31 |
+
|
| 32 |
+
## Abstract
|
| 33 |
+
|
| 34 |
+
This synthetic dataset captures household air pollution (HAP) exposure and clean cooking transitions across three scenarios in sub-Saharan Africa. Each record represents a household-year observation describing cooking fuel, kitchen ventilation, PM2.5 concentrations, exposure indices, and respiratory health risk proxies. Parameterization is informed by WHO household air pollution guidance and empirical PM2.5 measurements in rural Ethiopia.
|
| 35 |
+
|
| 36 |
+
The WHO reports that around 2.1 billion people still cook with polluting fuels, and household air pollution was responsible for an estimated 2.9 million deaths in 2021, including over 309,000 deaths in children under 5. Exposure to HAP nearly doubles childhood lower respiratory infection (LRI) risk and contributes to 44% of pneumonia deaths in children under 5 (WHO, 2023). A kitchen monitoring study in Northwest Ethiopia reported mean 24-hour kitchen PM2.5 concentrations of 405 µg/m³ (SD 221; range 52–965 µg/m³), underscoring the high exposure levels in biomass-using households (Yohannes et al., 2023). A large Malawian trial of cleaner-burning biomass cookstoves found no significant reduction in childhood pneumonia incidence (IRR 1.01), highlighting the limits of improved biomass stoves alone (Mortimer et al., 2017).
|
| 37 |
+
|
| 38 |
+
### Scenarios
|
| 39 |
+
|
| 40 |
+
- **Traditional Biomass**: Predominantly rural households using solid fuels, low ventilation, high PM2.5 exposure.
|
| 41 |
+
- **Improved Stove Rollout**: Expanded improved stove access with partial adoption and compliance; exposure declines but remains elevated.
|
| 42 |
+
- **Clean Fuel Transition**: Urban/peri-urban transition to LPG/electricity/biogas with lower exposures.
|
| 43 |
+
|
| 44 |
+
## Dataset Structure
|
| 45 |
+
|
| 46 |
+
Each scenario contains 10,000 records (30,000 total). Key columns include:
|
| 47 |
+
|
| 48 |
+
### Household Context
|
| 49 |
+
- `year`, `setting`, `household_size`, `children_u5`, `primary_cook_female`
|
| 50 |
+
- `cooking_hours_per_day`, `kitchen_type`, `ventilation_index`
|
| 51 |
+
|
| 52 |
+
### Fuel & Technology
|
| 53 |
+
- `fuel_type`, `cookstove_type`
|
| 54 |
+
- `clean_cooking_access`, `intervention_received`, `adoption_compliance`
|
| 55 |
+
|
| 56 |
+
### Exposure Metrics
|
| 57 |
+
- `pm25_kitchen_ugm3`, `co_ppm`, `exposure_hours`, `exposure_index`, `pm25_category`
|
| 58 |
+
|
| 59 |
+
### Health Risk Proxies
|
| 60 |
+
- `pneumonia_incidence_per100`, `child_lri_risk_ratio`
|
| 61 |
+
- `copd_risk_index`, `low_birthweight_risk`, `health_burden_score`
|
| 62 |
+
|
| 63 |
+
### Environmental & Time Costs
|
| 64 |
+
- `black_carbon_kg_per_day`, `fuel_kg_per_day`, `fuel_collection_hours`
|
| 65 |
+
|
| 66 |
+
## Parameterization Evidence
|
| 67 |
+
|
| 68 |
+
| Parameter | Value Used | Source | Year |
|
| 69 |
+
| --- | --- | --- | --- |
|
| 70 |
+
| 2.1B people rely on polluting cooking fuels | Global reliance baseline | WHO HAP factsheet | 2023 |
|
| 71 |
+
| 2.9M deaths annually; 44% of <5 pneumonia deaths attributable to HAP | Health burden & pneumonia linkage | WHO HAP factsheet | 2023 |
|
| 72 |
+
| Mean kitchen PM2.5 405 µg/m³ (range 52–965) in rural Ethiopia | PM2.5 exposure baseline | Yohannes et al., Frontiers Public Health | 2023 |
|
| 73 |
+
| No pneumonia reduction with cleaner biomass stoves (IRR 1.01) | Effect size for improved stoves | Mortimer et al., CAPS trial | 2017 |
|
| 74 |
+
|
| 75 |
+
## Validation Summary
|
| 76 |
+
|
| 77 |
+
The 8-panel validation report (`validation_report.png`) confirms:
|
| 78 |
+
|
| 79 |
+
1. **PM2.5 gradient**: Traditional biomass has the highest PM2.5, clean fuel the lowest, with improved stoves in between.
|
| 80 |
+
2. **CO exposure**: CO follows fuel and stove efficiency patterns aligned with PM2.5 trends.
|
| 81 |
+
3. **Exposure–health relationship**: Higher exposure indices align with increased pneumonia incidence proxies.
|
| 82 |
+
4. **Clean access effect**: Clean cooking access reduces mean PM2.5 across scenarios.
|
| 83 |
+
5. **Fuel mix**: Scenario-specific fuel distributions mirror expected transition patterns.
|
| 84 |
+
6. **Ventilation effects**: Higher ventilation indices lower PM2.5 concentrations.
|
| 85 |
+
7. **Burden score**: Composite health burden declines with cleaner fuel adoption.
|
| 86 |
+
8. **Time burden**: Biomass scenarios show greater fuel collection time.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
|
| 90 |
+
## Usage
|
| 91 |
+
|
| 92 |
+
```python
|
| 93 |
+
from datasets import load_dataset
|
| 94 |
+
|
| 95 |
+
# Default: improved stove rollout
|
| 96 |
+
subset = load_dataset("electricsheepafrica/indoor-air-pollution-clean-cooking", name="improved_stove_rollout")
|
| 97 |
+
df = subset["train"].to_pandas()
|
| 98 |
+
|
| 99 |
+
# Compare PM2.5 exposure by fuel type
|
| 100 |
+
print(df.groupby("fuel_type")["pm25_kitchen_ugm3"].mean().sort_values())
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
## Intended Uses
|
| 104 |
+
|
| 105 |
+
- Modeling health impacts of household air pollution in SSA
|
| 106 |
+
- Scenario analysis of clean cooking transitions and exposure reduction
|
| 107 |
+
- Training exposure-response models for respiratory disease risk
|
| 108 |
+
|
| 109 |
+
## Limitations
|
| 110 |
+
|
| 111 |
+
- **Synthetic data**: Not derived from direct household surveillance.
|
| 112 |
+
- **Simplified exposure model**: PM2.5 and CO depend on fuel, stove, and ventilation proxies only.
|
| 113 |
+
- **No spatial coordinates**: Scenario encodes geography implicitly.
|
| 114 |
+
- **Intervention effects**: Cookstove efficacy modeled as modest, reflecting mixed evidence.
|
| 115 |
+
|
| 116 |
+
## References
|
| 117 |
+
|
| 118 |
+
1. World Health Organization. Household air pollution and health. WHO Factsheet, 2023. https://www.who.int/news-room/fact-sheets/detail/household-air-pollution-and-health
|
| 119 |
+
2. Yohannes T, et al. Kitchen fine particulate matter (PM2.5) concentrations from biomass fuel use in rural households of Northwest Ethiopia. *Frontiers in Public Health*, 2023. https://www.frontiersin.org/journals/public-health/articles/10.3389/fpubh.2023.1241977/full
|
| 120 |
+
3. Mortimer K, et al. A cleaner burning biomass-fuelled cookstove intervention to prevent pneumonia in children under 5 years old in rural Malawi (CAPS trial). *Lancet* 2017;389:167–75. https://pubmed.ncbi.nlm.nih.gov/27939058/
|
| 121 |
+
|
| 122 |
+
## Citation
|
| 123 |
+
|
| 124 |
+
```bibtex
|
| 125 |
+
@dataset{electricsheepafrica_indoor_air_pollution_clean_cooking_2025,
|
| 126 |
+
title={Indoor Air Pollution and Clean Cooking in Sub-Saharan Africa},
|
| 127 |
+
author={Electric Sheep Africa},
|
| 128 |
+
year={2025},
|
| 129 |
+
publisher={HuggingFace},
|
| 130 |
+
url={https://huggingface.co/datasets/electricsheepafrica/indoor-air-pollution-clean-cooking}
|
| 131 |
+
}
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
## License
|
| 135 |
+
|
| 136 |
+
CC-BY-4.0
|
data/indoor_air_clean_fuel_transition.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/indoor_air_improved_stove_rollout.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/indoor_air_traditional_biomass.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
generate_dataset.py
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Generate synthetic indoor air pollution & clean cooking dataset."""
|
| 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 |
+
CLEAN_FUELS = {"lpg", "electricity", "biogas", "ethanol"}
|
| 18 |
+
BIOMASS_FUELS = {"wood", "charcoal", "dung", "crop_residue"}
|
| 19 |
+
|
| 20 |
+
FUEL_PM25_FACTOR = {
|
| 21 |
+
"wood": 1.0,
|
| 22 |
+
"charcoal": 0.85,
|
| 23 |
+
"dung": 1.15,
|
| 24 |
+
"crop_residue": 1.05,
|
| 25 |
+
"kerosene": 0.65,
|
| 26 |
+
"lpg": 0.2,
|
| 27 |
+
"electricity": 0.05,
|
| 28 |
+
"biogas": 0.2,
|
| 29 |
+
"ethanol": 0.2,
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
FUEL_CO_FACTOR = {
|
| 33 |
+
"wood": 1.0,
|
| 34 |
+
"charcoal": 0.8,
|
| 35 |
+
"dung": 1.1,
|
| 36 |
+
"crop_residue": 1.0,
|
| 37 |
+
"kerosene": 0.6,
|
| 38 |
+
"lpg": 0.25,
|
| 39 |
+
"electricity": 0.05,
|
| 40 |
+
"biogas": 0.25,
|
| 41 |
+
"ethanol": 0.25,
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
STOVE_PM25_FACTOR = {"traditional": 1.0, "improved": 0.75, "clean": 0.3}
|
| 45 |
+
|
| 46 |
+
FUEL_BC_FACTOR = {
|
| 47 |
+
"wood": 0.08,
|
| 48 |
+
"charcoal": 0.05,
|
| 49 |
+
"dung": 0.1,
|
| 50 |
+
"crop_residue": 0.07,
|
| 51 |
+
"kerosene": 0.03,
|
| 52 |
+
"lpg": 0.01,
|
| 53 |
+
"electricity": 0.0,
|
| 54 |
+
"biogas": 0.01,
|
| 55 |
+
"ethanol": 0.01,
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
FUEL_CONSUMPTION_FACTOR = {
|
| 59 |
+
"wood": 1.2,
|
| 60 |
+
"charcoal": 0.8,
|
| 61 |
+
"dung": 1.0,
|
| 62 |
+
"crop_residue": 0.9,
|
| 63 |
+
"kerosene": 0.4,
|
| 64 |
+
"lpg": 0.2,
|
| 65 |
+
"electricity": 0.0,
|
| 66 |
+
"biogas": 0.1,
|
| 67 |
+
"ethanol": 0.1,
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
KITCHEN_VENTILATION = {"enclosed": 0.2, "semi_open": 0.4, "open": 0.65}
|
| 71 |
+
|
| 72 |
+
SCENARIOS = {
|
| 73 |
+
"traditional_biomass": {
|
| 74 |
+
"setting_probs": {"rural": 0.7, "peri_urban": 0.2, "urban": 0.1},
|
| 75 |
+
"fuel_probs": {
|
| 76 |
+
"wood": 0.45,
|
| 77 |
+
"charcoal": 0.2,
|
| 78 |
+
"dung": 0.2,
|
| 79 |
+
"crop_residue": 0.1,
|
| 80 |
+
"kerosene": 0.05,
|
| 81 |
+
},
|
| 82 |
+
"cookstove_probs": {"traditional": 0.85, "improved": 0.1, "clean": 0.05},
|
| 83 |
+
"kitchen_probs": {"enclosed": 0.6, "semi_open": 0.3, "open": 0.1},
|
| 84 |
+
"pm25_mean": 420,
|
| 85 |
+
"pm25_sd": 180,
|
| 86 |
+
"co_mean": 18,
|
| 87 |
+
"co_sd": 7,
|
| 88 |
+
"ventilation_mean": 0.25,
|
| 89 |
+
"cooking_hours_mean": 3.0,
|
| 90 |
+
"intervention_coverage": 0.1,
|
| 91 |
+
"adoption_rate": 0.4,
|
| 92 |
+
"compliance_mean": 0.6,
|
| 93 |
+
"baseline_pneumonia": 16.5,
|
| 94 |
+
"household_size_mean": 5.4,
|
| 95 |
+
"household_size_sd": 1.6,
|
| 96 |
+
"children_u5_mean": 1.2,
|
| 97 |
+
},
|
| 98 |
+
"improved_stove_rollout": {
|
| 99 |
+
"setting_probs": {"rural": 0.6, "peri_urban": 0.25, "urban": 0.15},
|
| 100 |
+
"fuel_probs": {
|
| 101 |
+
"wood": 0.35,
|
| 102 |
+
"charcoal": 0.2,
|
| 103 |
+
"dung": 0.15,
|
| 104 |
+
"crop_residue": 0.1,
|
| 105 |
+
"kerosene": 0.05,
|
| 106 |
+
"lpg": 0.1,
|
| 107 |
+
"electricity": 0.05,
|
| 108 |
+
},
|
| 109 |
+
"cookstove_probs": {"traditional": 0.45, "improved": 0.45, "clean": 0.1},
|
| 110 |
+
"kitchen_probs": {"enclosed": 0.5, "semi_open": 0.35, "open": 0.15},
|
| 111 |
+
"pm25_mean": 260,
|
| 112 |
+
"pm25_sd": 120,
|
| 113 |
+
"co_mean": 12,
|
| 114 |
+
"co_sd": 5,
|
| 115 |
+
"ventilation_mean": 0.35,
|
| 116 |
+
"cooking_hours_mean": 2.7,
|
| 117 |
+
"intervention_coverage": 0.6,
|
| 118 |
+
"adoption_rate": 0.55,
|
| 119 |
+
"compliance_mean": 0.65,
|
| 120 |
+
"baseline_pneumonia": 15.5,
|
| 121 |
+
"household_size_mean": 5.2,
|
| 122 |
+
"household_size_sd": 1.5,
|
| 123 |
+
"children_u5_mean": 1.1,
|
| 124 |
+
},
|
| 125 |
+
"clean_fuel_transition": {
|
| 126 |
+
"setting_probs": {"urban": 0.45, "peri_urban": 0.35, "rural": 0.2},
|
| 127 |
+
"fuel_probs": {
|
| 128 |
+
"lpg": 0.35,
|
| 129 |
+
"electricity": 0.25,
|
| 130 |
+
"biogas": 0.1,
|
| 131 |
+
"charcoal": 0.15,
|
| 132 |
+
"wood": 0.1,
|
| 133 |
+
"ethanol": 0.05,
|
| 134 |
+
},
|
| 135 |
+
"cookstove_probs": {"clean": 0.65, "improved": 0.2, "traditional": 0.15},
|
| 136 |
+
"kitchen_probs": {"enclosed": 0.4, "semi_open": 0.35, "open": 0.25},
|
| 137 |
+
"pm25_mean": 70,
|
| 138 |
+
"pm25_sd": 35,
|
| 139 |
+
"co_mean": 4,
|
| 140 |
+
"co_sd": 2,
|
| 141 |
+
"ventilation_mean": 0.5,
|
| 142 |
+
"cooking_hours_mean": 2.3,
|
| 143 |
+
"intervention_coverage": 0.8,
|
| 144 |
+
"adoption_rate": 0.75,
|
| 145 |
+
"compliance_mean": 0.8,
|
| 146 |
+
"baseline_pneumonia": 13.0,
|
| 147 |
+
"household_size_mean": 4.9,
|
| 148 |
+
"household_size_sd": 1.4,
|
| 149 |
+
"children_u5_mean": 0.9,
|
| 150 |
+
},
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
SCENARIO_FILES = {
|
| 154 |
+
"traditional_biomass": "indoor_air_traditional_biomass.csv",
|
| 155 |
+
"improved_stove_rollout": "indoor_air_improved_stove_rollout.csv",
|
| 156 |
+
"clean_fuel_transition": "indoor_air_clean_fuel_transition.csv",
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
def _choice(rng: np.random.Generator, prob_map: dict[str, float]) -> str:
|
| 161 |
+
keys = list(prob_map.keys())
|
| 162 |
+
weights = np.array(list(prob_map.values()), dtype=float)
|
| 163 |
+
weights = weights / weights.sum()
|
| 164 |
+
return rng.choice(keys, p=weights)
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
def _sample_year(rng: np.random.Generator) -> int:
|
| 168 |
+
return int(rng.choice(YEAR_RANGE, p=YEAR_WEIGHTS))
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
def _simulate_scenario(name: str, params: dict[str, float], seed: int) -> pd.DataFrame:
|
| 172 |
+
rng = np.random.default_rng(seed)
|
| 173 |
+
records = []
|
| 174 |
+
|
| 175 |
+
for idx in range(N_PER_SCENARIO):
|
| 176 |
+
setting = _choice(rng, params["setting_probs"])
|
| 177 |
+
kitchen_type = _choice(rng, params["kitchen_probs"])
|
| 178 |
+
fuel_type = _choice(rng, params["fuel_probs"])
|
| 179 |
+
cookstove_type = _choice(rng, params["cookstove_probs"])
|
| 180 |
+
household_size = int(
|
| 181 |
+
np.clip(
|
| 182 |
+
rng.normal(params["household_size_mean"], params["household_size_sd"]), 2, 11
|
| 183 |
+
)
|
| 184 |
+
)
|
| 185 |
+
children_u5 = int(np.clip(rng.poisson(params["children_u5_mean"]), 0, 4))
|
| 186 |
+
cooking_hours = float(np.clip(rng.normal(params["cooking_hours_mean"], 0.6), 1.2, 5.5))
|
| 187 |
+
ventilation_index = float(
|
| 188 |
+
np.clip(rng.normal(KITCHEN_VENTILATION[kitchen_type], 0.07), 0.1, 0.9)
|
| 189 |
+
)
|
| 190 |
+
|
| 191 |
+
intervention_received = rng.random() < params["intervention_coverage"]
|
| 192 |
+
adoption = intervention_received and rng.random() < params["adoption_rate"]
|
| 193 |
+
compliance = float(np.clip(rng.normal(params["compliance_mean"], 0.15), 0.2, 1.0))
|
| 194 |
+
if not adoption:
|
| 195 |
+
compliance = 0.0
|
| 196 |
+
|
| 197 |
+
clean_access = fuel_type in CLEAN_FUELS or cookstove_type == "clean"
|
| 198 |
+
|
| 199 |
+
base_pm25 = max(20.0, rng.normal(params["pm25_mean"], params["pm25_sd"]))
|
| 200 |
+
vent_factor = 1.1 - ventilation_index * 0.6
|
| 201 |
+
pm25 = (
|
| 202 |
+
base_pm25
|
| 203 |
+
* FUEL_PM25_FACTOR[fuel_type]
|
| 204 |
+
* STOVE_PM25_FACTOR[cookstove_type]
|
| 205 |
+
* vent_factor
|
| 206 |
+
)
|
| 207 |
+
pm25 = float(np.clip(pm25, 15, 1200))
|
| 208 |
+
|
| 209 |
+
co_ppm = (
|
| 210 |
+
rng.normal(params["co_mean"], params["co_sd"])
|
| 211 |
+
* FUEL_CO_FACTOR[fuel_type]
|
| 212 |
+
* STOVE_PM25_FACTOR[cookstove_type]
|
| 213 |
+
* (1.05 - ventilation_index * 0.5)
|
| 214 |
+
)
|
| 215 |
+
co_ppm = float(np.clip(co_ppm, 0.5, 80))
|
| 216 |
+
|
| 217 |
+
exposure_hours = float(cooking_hours * rng.uniform(0.5, 0.9))
|
| 218 |
+
exposure_index = float(pm25 * exposure_hours / 24)
|
| 219 |
+
|
| 220 |
+
lri_rr = 1 + np.clip((pm25 - 50) / 450, 0, 1) * 0.9
|
| 221 |
+
stove_health_factor = 1.0
|
| 222 |
+
if cookstove_type == "clean":
|
| 223 |
+
stove_health_factor = 0.85
|
| 224 |
+
elif cookstove_type == "improved":
|
| 225 |
+
stove_health_factor = 0.98
|
| 226 |
+
|
| 227 |
+
pneumonia_incidence = params["baseline_pneumonia"] * lri_rr * stove_health_factor
|
| 228 |
+
if clean_access and compliance > 0:
|
| 229 |
+
pneumonia_incidence *= 1 - 0.05 * compliance
|
| 230 |
+
pneumonia_incidence = float(np.clip(pneumonia_incidence, 5, 40))
|
| 231 |
+
|
| 232 |
+
copd_risk_index = float(np.clip(0.2 + (pm25 / 600) * 0.8, 0.2, 1.0))
|
| 233 |
+
low_birthweight_risk = float(np.clip(0.08 + (pm25 / 600) * 0.12, 0.05, 0.35))
|
| 234 |
+
|
| 235 |
+
health_burden_score = float(
|
| 236 |
+
np.clip(
|
| 237 |
+
(pneumonia_incidence / 30) * 0.4
|
| 238 |
+
+ copd_risk_index * 0.35
|
| 239 |
+
+ low_birthweight_risk * 0.25,
|
| 240 |
+
0,
|
| 241 |
+
1,
|
| 242 |
+
)
|
| 243 |
+
)
|
| 244 |
+
|
| 245 |
+
black_carbon_kg_per_day = float(
|
| 246 |
+
FUEL_BC_FACTOR[fuel_type] * cooking_hours * (0.3 if cookstove_type == "clean" else 1)
|
| 247 |
+
)
|
| 248 |
+
fuel_kg_per_day = float(FUEL_CONSUMPTION_FACTOR[fuel_type] * cooking_hours)
|
| 249 |
+
|
| 250 |
+
if fuel_type in BIOMASS_FUELS:
|
| 251 |
+
base_collection = 1.3 if setting == "rural" else 0.8
|
| 252 |
+
fuel_collection_hours = float(np.clip(rng.normal(base_collection, 0.4), 0.1, 3.5))
|
| 253 |
+
else:
|
| 254 |
+
fuel_collection_hours = float(np.clip(rng.normal(0.2, 0.1), 0.0, 0.6))
|
| 255 |
+
|
| 256 |
+
if pm25 >= 500:
|
| 257 |
+
pm25_category = "extreme"
|
| 258 |
+
elif pm25 >= 250:
|
| 259 |
+
pm25_category = "high"
|
| 260 |
+
elif pm25 >= 100:
|
| 261 |
+
pm25_category = "moderate"
|
| 262 |
+
else:
|
| 263 |
+
pm25_category = "low"
|
| 264 |
+
|
| 265 |
+
record = {
|
| 266 |
+
"record_id": f"{name[:3].upper()}-{idx:05d}",
|
| 267 |
+
"scenario": name,
|
| 268 |
+
"year": _sample_year(rng),
|
| 269 |
+
"setting": setting,
|
| 270 |
+
"household_size": household_size,
|
| 271 |
+
"children_u5": children_u5,
|
| 272 |
+
"primary_cook_female": int(rng.random() < 0.82),
|
| 273 |
+
"cooking_hours_per_day": cooking_hours,
|
| 274 |
+
"kitchen_type": kitchen_type,
|
| 275 |
+
"ventilation_index": ventilation_index,
|
| 276 |
+
"fuel_type": fuel_type,
|
| 277 |
+
"cookstove_type": cookstove_type,
|
| 278 |
+
"clean_cooking_access": int(clean_access),
|
| 279 |
+
"intervention_received": int(intervention_received),
|
| 280 |
+
"adoption_compliance": compliance,
|
| 281 |
+
"pm25_kitchen_ugm3": pm25,
|
| 282 |
+
"co_ppm": co_ppm,
|
| 283 |
+
"exposure_hours": exposure_hours,
|
| 284 |
+
"exposure_index": exposure_index,
|
| 285 |
+
"pm25_category": pm25_category,
|
| 286 |
+
"pneumonia_incidence_per100": pneumonia_incidence,
|
| 287 |
+
"child_lri_risk_ratio": lri_rr,
|
| 288 |
+
"copd_risk_index": copd_risk_index,
|
| 289 |
+
"low_birthweight_risk": low_birthweight_risk,
|
| 290 |
+
"health_burden_score": health_burden_score,
|
| 291 |
+
"black_carbon_kg_per_day": black_carbon_kg_per_day,
|
| 292 |
+
"fuel_kg_per_day": fuel_kg_per_day,
|
| 293 |
+
"fuel_collection_hours": fuel_collection_hours,
|
| 294 |
+
}
|
| 295 |
+
records.append(record)
|
| 296 |
+
|
| 297 |
+
return pd.DataFrame(records)
|
| 298 |
+
|
| 299 |
+
|
| 300 |
+
def main() -> None:
|
| 301 |
+
output_dir = Path("data")
|
| 302 |
+
output_dir.mkdir(parents=True, exist_ok=True)
|
| 303 |
+
|
| 304 |
+
for idx, (name, params) in enumerate(SCENARIOS.items()):
|
| 305 |
+
df = _simulate_scenario(name, params, SEED + idx * 211)
|
| 306 |
+
df.to_csv(output_dir / SCENARIO_FILES[name], index=False)
|
| 307 |
+
print(f"Saved {name} -> {SCENARIO_FILES[name]}")
|
| 308 |
+
|
| 309 |
+
|
| 310 |
+
if __name__ == "__main__":
|
| 311 |
+
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,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Validate synthetic indoor air pollution & clean cooking 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 |
+
"traditional_biomass": "indoor_air_traditional_biomass.csv",
|
| 12 |
+
"improved_stove_rollout": "indoor_air_improved_stove_rollout.csv",
|
| 13 |
+
"clean_fuel_transition": "indoor_air_clean_fuel_transition.csv",
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
COLORS = {
|
| 17 |
+
"traditional_biomass": "#a63603",
|
| 18 |
+
"improved_stove_rollout": "#ef6548",
|
| 19 |
+
"clean_fuel_transition": "#3182bd",
|
| 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 |
+
df["scenario"] = scenario
|
| 28 |
+
frames.append(df)
|
| 29 |
+
return pd.concat(frames, ignore_index=True)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def plot_validation(df: pd.DataFrame, output_path: Path) -> None:
|
| 33 |
+
fig, axes = plt.subplots(4, 2, figsize=(14, 16))
|
| 34 |
+
axes = axes.flatten()
|
| 35 |
+
|
| 36 |
+
# Panel 1: PM2.5 by scenario
|
| 37 |
+
pm25_data = [df[df["scenario"] == s]["pm25_kitchen_ugm3"] for s in SCENARIO_FILES]
|
| 38 |
+
axes[0].boxplot(pm25_data, labels=SCENARIO_FILES.keys(), patch_artist=True)
|
| 39 |
+
for patch, scenario in zip(axes[0].artists, SCENARIO_FILES.keys()):
|
| 40 |
+
patch.set_facecolor(COLORS[scenario])
|
| 41 |
+
patch.set_alpha(0.6)
|
| 42 |
+
axes[0].set_title("Kitchen PM2.5 by scenario (µg/m³)")
|
| 43 |
+
axes[0].set_ylabel("PM2.5")
|
| 44 |
+
|
| 45 |
+
# Panel 2: CO by scenario
|
| 46 |
+
co_data = [df[df["scenario"] == s]["co_ppm"] for s in SCENARIO_FILES]
|
| 47 |
+
axes[1].boxplot(co_data, labels=SCENARIO_FILES.keys(), patch_artist=True)
|
| 48 |
+
for patch, scenario in zip(axes[1].artists, SCENARIO_FILES.keys()):
|
| 49 |
+
patch.set_facecolor(COLORS[scenario])
|
| 50 |
+
patch.set_alpha(0.6)
|
| 51 |
+
axes[1].set_title("CO exposure proxy by scenario (ppm)")
|
| 52 |
+
axes[1].set_ylabel("CO ppm")
|
| 53 |
+
|
| 54 |
+
# Panel 3: Exposure index vs pneumonia incidence
|
| 55 |
+
for scenario in SCENARIO_FILES:
|
| 56 |
+
subset = df[df["scenario"] == scenario]
|
| 57 |
+
axes[2].scatter(
|
| 58 |
+
subset["exposure_index"],
|
| 59 |
+
subset["pneumonia_incidence_per100"],
|
| 60 |
+
s=8,
|
| 61 |
+
alpha=0.25,
|
| 62 |
+
color=COLORS[scenario],
|
| 63 |
+
label=scenario,
|
| 64 |
+
)
|
| 65 |
+
axes[2].set_title("Exposure index vs pneumonia incidence")
|
| 66 |
+
axes[2].set_xlabel("Exposure index")
|
| 67 |
+
axes[2].set_ylabel("Pneumonia incidence /100")
|
| 68 |
+
axes[2].legend(fontsize=8, loc="upper left")
|
| 69 |
+
|
| 70 |
+
# Panel 4: Clean cooking access vs PM2.5
|
| 71 |
+
access_stats = (
|
| 72 |
+
df.groupby(["scenario", "clean_cooking_access"])["pm25_kitchen_ugm3"]
|
| 73 |
+
.mean()
|
| 74 |
+
.unstack()
|
| 75 |
+
)
|
| 76 |
+
access_stats.plot(kind="bar", ax=axes[3], color=["#bdbdbd", "#2ca25f"])
|
| 77 |
+
axes[3].set_title("Mean PM2.5 by clean cooking access")
|
| 78 |
+
axes[3].set_ylabel("PM2.5 µg/m³")
|
| 79 |
+
axes[3].set_xlabel("Scenario")
|
| 80 |
+
axes[3].legend(["No clean access", "Clean access"], fontsize=8)
|
| 81 |
+
|
| 82 |
+
# Panel 5: Fuel mix by scenario
|
| 83 |
+
fuel_counts = (
|
| 84 |
+
df.groupby(["scenario", "fuel_type"]).size().groupby(level=0).apply(lambda s: s / s.sum())
|
| 85 |
+
)
|
| 86 |
+
fuel_counts.unstack().plot(kind="bar", stacked=True, ax=axes[4], legend=False)
|
| 87 |
+
axes[4].set_title("Fuel mix by scenario")
|
| 88 |
+
axes[4].set_ylabel("Share")
|
| 89 |
+
|
| 90 |
+
# Panel 6: Ventilation vs PM2.5
|
| 91 |
+
for scenario in SCENARIO_FILES:
|
| 92 |
+
subset = df[df["scenario"] == scenario]
|
| 93 |
+
axes[5].scatter(
|
| 94 |
+
subset["ventilation_index"],
|
| 95 |
+
subset["pm25_kitchen_ugm3"],
|
| 96 |
+
s=8,
|
| 97 |
+
alpha=0.25,
|
| 98 |
+
color=COLORS[scenario],
|
| 99 |
+
)
|
| 100 |
+
axes[5].set_title("Ventilation index vs PM2.5")
|
| 101 |
+
axes[5].set_xlabel("Ventilation index")
|
| 102 |
+
axes[5].set_ylabel("PM2.5 µg/m³")
|
| 103 |
+
|
| 104 |
+
# Panel 7: Health burden score by scenario
|
| 105 |
+
hb_data = [df[df["scenario"] == s]["health_burden_score"] for s in SCENARIO_FILES]
|
| 106 |
+
axes[6].boxplot(hb_data, labels=SCENARIO_FILES.keys(), patch_artist=True)
|
| 107 |
+
for patch, scenario in zip(axes[6].artists, SCENARIO_FILES.keys()):
|
| 108 |
+
patch.set_facecolor(COLORS[scenario])
|
| 109 |
+
patch.set_alpha(0.6)
|
| 110 |
+
axes[6].set_title("Composite health burden score")
|
| 111 |
+
axes[6].set_ylabel("Score")
|
| 112 |
+
|
| 113 |
+
# Panel 8: Fuel collection time
|
| 114 |
+
fc_data = [df[df["scenario"] == s]["fuel_collection_hours"] for s in SCENARIO_FILES]
|
| 115 |
+
axes[7].boxplot(fc_data, labels=SCENARIO_FILES.keys(), patch_artist=True)
|
| 116 |
+
for patch, scenario in zip(axes[7].artists, SCENARIO_FILES.keys()):
|
| 117 |
+
patch.set_facecolor(COLORS[scenario])
|
| 118 |
+
patch.set_alpha(0.6)
|
| 119 |
+
axes[7].set_title("Fuel collection time (hours/day)")
|
| 120 |
+
axes[7].set_ylabel("Hours")
|
| 121 |
+
|
| 122 |
+
plt.tight_layout()
|
| 123 |
+
fig.savefig(output_path, dpi=200)
|
| 124 |
+
plt.close(fig)
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
def main() -> None:
|
| 128 |
+
df = load_data()
|
| 129 |
+
output_path = Path("validation_report.png")
|
| 130 |
+
plot_validation(df, output_path)
|
| 131 |
+
print(f"Saved {output_path}")
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
if __name__ == "__main__":
|
| 135 |
+
main()
|
validation_report.png
ADDED
|
Git LFS Details
|