Datasets:
Upload folder using huggingface_hub
Browse files- README.md +88 -0
- data/radon_granite_rural.csv +0 -0
- data/radon_occupational.csv +0 -0
- data/radon_urban_residential.csv +0 -0
- generate_dataset.py +185 -0
- requirements.txt +3 -0
- validate_dataset.py +92 -0
- validation_report.png +3 -0
README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- tabular-classification
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- environmental-health
|
| 9 |
+
- radon
|
| 10 |
+
- indoor-radiation
|
| 11 |
+
- lung-cancer
|
| 12 |
+
- building-materials
|
| 13 |
+
- synthetic
|
| 14 |
+
- sub-saharan-africa
|
| 15 |
+
pretty_name: Radon & Indoor Radiation Exposure (SSA)
|
| 16 |
+
size_categories:
|
| 17 |
+
- 10K<n<100K
|
| 18 |
+
configs:
|
| 19 |
+
- config_name: granite_geology_rural
|
| 20 |
+
data_files: data/radon_granite_rural.csv
|
| 21 |
+
default: true
|
| 22 |
+
- config_name: urban_residential
|
| 23 |
+
data_files: data/radon_urban_residential.csv
|
| 24 |
+
- config_name: occupational_underground
|
| 25 |
+
data_files: data/radon_occupational.csv
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
# Radon & Indoor Radiation Exposure in Sub-Saharan Africa
|
| 29 |
+
|
| 30 |
+
## Abstract
|
| 31 |
+
|
| 32 |
+
Synthetic dataset modelling indoor radon concentrations, building characteristics, and lung cancer risk across three settings in SSA. Radon is the second leading cause of lung cancer globally; WHO recommends 100 Bq/m³ reference level. Granite geology, poor ventilation, and ground-level dwellings increase concentrations.
|
| 33 |
+
|
| 34 |
+
### Scenarios
|
| 35 |
+
|
| 36 |
+
- **Granite Geology Rural**: Communities on granite bedrock with mean radon ~120 Bq/m³.
|
| 37 |
+
- **Urban Residential**: Mixed urban buildings with mean ~60 Bq/m³.
|
| 38 |
+
- **Occupational Underground**: Mines, tunnels, basements with mean ~250 Bq/m³.
|
| 39 |
+
|
| 40 |
+
## Parameterization Evidence
|
| 41 |
+
|
| 42 |
+
| Parameter | Value | Source | Year |
|
| 43 |
+
| --- | --- | --- | --- |
|
| 44 |
+
| Radon causes 3-14% of lung cancers; 100 Bq/m³ ref | Guideline | WHO Fact Sheet | 2023 |
|
| 45 |
+
| Indoor radon in Africa: critical review | SSA data | PMC12277776 | 2025 |
|
| 46 |
+
| ~50% of human radiation exposure from radon | Burden | PMC12081354 | 2025 |
|
| 47 |
+
| Nigerian buildings radon monitoring | SSA data | PubMed 40334468 | 2025 |
|
| 48 |
+
| SA community near granite: alpha particle damage | SSA data | PMC12331818 | 2025 |
|
| 49 |
+
|
| 50 |
+
## Validation
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
|
| 54 |
+
## Usage
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
from datasets import load_dataset
|
| 58 |
+
ds = load_dataset("electricsheepafrica/radon-indoor-radiation", "granite_geology_rural")
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Limitations
|
| 62 |
+
|
| 63 |
+
- Synthetic data; not for clinical decision-making.
|
| 64 |
+
- Radon concentrations vary seasonally and diurnally; dataset captures annual average.
|
| 65 |
+
- Limited real measurement data from SSA to validate distributions.
|
| 66 |
+
|
| 67 |
+
## References
|
| 68 |
+
|
| 69 |
+
1. WHO. Radon and Health Fact Sheet. 2023.
|
| 70 |
+
2. PMC12277776. Indoor radon exposure in Africa: critical review. 2025.
|
| 71 |
+
3. PMC12081354. Lung cancer attributed to residential radon. 2025.
|
| 72 |
+
4. PMC12331818. Indoor radon in SA community near granite. 2025.
|
| 73 |
+
|
| 74 |
+
## Citation
|
| 75 |
+
|
| 76 |
+
```bibtex
|
| 77 |
+
@dataset{electricsheepafrica_radon_indoor_radiation_2025,
|
| 78 |
+
title={Radon and Indoor Radiation Exposure in Sub-Saharan Africa},
|
| 79 |
+
author={Electric Sheep Africa},
|
| 80 |
+
year={2025},
|
| 81 |
+
publisher={HuggingFace},
|
| 82 |
+
url={https://huggingface.co/datasets/electricsheepafrica/radon-indoor-radiation}
|
| 83 |
+
}
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## License
|
| 87 |
+
|
| 88 |
+
CC-BY-4.0
|
data/radon_granite_rural.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/radon_occupational.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/radon_urban_residential.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
generate_dataset.py
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Generate synthetic radon & indoor radiation exposure dataset for SSA.
|
| 2 |
+
|
| 3 |
+
Research-based parameterization:
|
| 4 |
+
- WHO Fact Sheet: Radon causes 3-14% of lung cancers; reference level
|
| 5 |
+
100 Bq/m³, action level 300 Bq/m³.
|
| 6 |
+
- PMC12277776: Indoor radon exposure in Africa critical review; growing
|
| 7 |
+
concern; classified IARC Group 1 carcinogen.
|
| 8 |
+
- PMC12081354: Radon = ~50% of human radiation exposure; originates from
|
| 9 |
+
granite, brick, sand, cement, gypsum.
|
| 10 |
+
- PubMed 40334468: Nigerian buildings (homes, schools, workplaces)
|
| 11 |
+
monitored; significant public health concern.
|
| 12 |
+
- PMC12331818: SA community near granite geology; alpha particles from
|
| 13 |
+
radon daughters damage lung cells.
|
| 14 |
+
- Second leading cause of lung cancer globally after smoking.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
from __future__ import annotations
|
| 18 |
+
|
| 19 |
+
from pathlib import Path
|
| 20 |
+
|
| 21 |
+
import numpy as np
|
| 22 |
+
import pandas as pd
|
| 23 |
+
|
| 24 |
+
SEED = 42
|
| 25 |
+
N_PER_SCENARIO = 10_000
|
| 26 |
+
|
| 27 |
+
YEAR_RANGE = np.arange(2010, 2025)
|
| 28 |
+
YEAR_WEIGHTS = np.linspace(0.85, 1.3, len(YEAR_RANGE))
|
| 29 |
+
YEAR_WEIGHTS = YEAR_WEIGHTS / YEAR_WEIGHTS.sum()
|
| 30 |
+
|
| 31 |
+
SCENARIOS = {
|
| 32 |
+
"granite_geology_rural": {
|
| 33 |
+
"setting_probs": {"rural_granite": 0.50, "peri_urban": 0.30, "mining_town": 0.20},
|
| 34 |
+
"building_probs": {"mud_brick": 0.30, "concrete_block": 0.25,
|
| 35 |
+
"stone_granite": 0.25, "corrugated_iron": 0.15, "modern": 0.05},
|
| 36 |
+
"radon_gm": 120, "radon_gsd": 2.2,
|
| 37 |
+
"ventilation_poor_pct": 0.55,
|
| 38 |
+
"smoking_prev": 0.15,
|
| 39 |
+
"lung_cancer_base": 0.003,
|
| 40 |
+
"measurement_pct": 0.02,
|
| 41 |
+
},
|
| 42 |
+
"urban_residential": {
|
| 43 |
+
"setting_probs": {"urban_formal": 0.40, "urban_informal": 0.35, "peri_urban": 0.25},
|
| 44 |
+
"building_probs": {"concrete_block": 0.40, "brick": 0.25,
|
| 45 |
+
"corrugated_iron": 0.15, "modern": 0.15, "mud_brick": 0.05},
|
| 46 |
+
"radon_gm": 60, "radon_gsd": 2.0,
|
| 47 |
+
"ventilation_poor_pct": 0.35,
|
| 48 |
+
"smoking_prev": 0.20,
|
| 49 |
+
"lung_cancer_base": 0.002,
|
| 50 |
+
"measurement_pct": 0.05,
|
| 51 |
+
},
|
| 52 |
+
"occupational_underground": {
|
| 53 |
+
"setting_probs": {"underground_mine": 0.45, "tunnel_cave": 0.20,
|
| 54 |
+
"basement_building": 0.20, "industrial": 0.15},
|
| 55 |
+
"building_probs": {"underground": 0.45, "concrete_block": 0.25,
|
| 56 |
+
"stone_granite": 0.15, "modern": 0.10, "other": 0.05},
|
| 57 |
+
"radon_gm": 250, "radon_gsd": 2.5,
|
| 58 |
+
"ventilation_poor_pct": 0.45,
|
| 59 |
+
"smoking_prev": 0.20,
|
| 60 |
+
"lung_cancer_base": 0.005,
|
| 61 |
+
"measurement_pct": 0.08,
|
| 62 |
+
},
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
SCENARIO_FILES = {
|
| 66 |
+
"granite_geology_rural": "radon_granite_rural.csv",
|
| 67 |
+
"urban_residential": "radon_urban_residential.csv",
|
| 68 |
+
"occupational_underground": "radon_occupational.csv",
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def _choice(rng, prob_map):
|
| 73 |
+
keys = list(prob_map.keys())
|
| 74 |
+
weights = np.array(list(prob_map.values()), dtype=float)
|
| 75 |
+
weights = weights / weights.sum()
|
| 76 |
+
return rng.choice(keys, p=weights)
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def _simulate_scenario(name, params, seed):
|
| 80 |
+
rng = np.random.default_rng(seed)
|
| 81 |
+
records = []
|
| 82 |
+
|
| 83 |
+
for idx in range(N_PER_SCENARIO):
|
| 84 |
+
year = int(rng.choice(YEAR_RANGE, p=YEAR_WEIGHTS))
|
| 85 |
+
setting = _choice(rng, params["setting_probs"])
|
| 86 |
+
age = int(np.clip(rng.normal(40, 15), 18, 80))
|
| 87 |
+
sex = rng.choice(["male", "female"], p=[0.50, 0.50])
|
| 88 |
+
building_type = _choice(rng, params["building_probs"])
|
| 89 |
+
|
| 90 |
+
# Ventilation (poor ventilation increases radon accumulation)
|
| 91 |
+
ventilation_poor = int(rng.random() < params["ventilation_poor_pct"])
|
| 92 |
+
floor_level = rng.choice(["ground_basement", "first", "upper"],
|
| 93 |
+
p=[0.60, 0.25, 0.15])
|
| 94 |
+
|
| 95 |
+
# Radon concentration (Bq/m³)
|
| 96 |
+
vent_mult = 1.5 if ventilation_poor else 1.0
|
| 97 |
+
floor_mult = 1.3 if floor_level == "ground_basement" else 0.8 if floor_level == "upper" else 1.0
|
| 98 |
+
geology_mult = 1.3 if building_type in ("stone_granite", "underground") else 1.0
|
| 99 |
+
|
| 100 |
+
radon_bqm3 = float(np.clip(
|
| 101 |
+
rng.lognormal(np.log(params["radon_gm"] * vent_mult * floor_mult * geology_mult),
|
| 102 |
+
np.log(params["radon_gsd"])),
|
| 103 |
+
5, 3000))
|
| 104 |
+
|
| 105 |
+
above_who_100 = int(radon_bqm3 > 100)
|
| 106 |
+
above_action_300 = int(radon_bqm3 > 300)
|
| 107 |
+
|
| 108 |
+
# Exposure
|
| 109 |
+
hours_indoors_day = float(np.clip(rng.normal(16, 3), 8, 23))
|
| 110 |
+
exposure_years = int(np.clip(rng.normal(15, 8), 1, 50))
|
| 111 |
+
occupancy_factor = hours_indoors_day / 24
|
| 112 |
+
cumulative_exposure = float(radon_bqm3 * occupancy_factor * exposure_years)
|
| 113 |
+
|
| 114 |
+
smoking = int(rng.random() < params["smoking_prev"])
|
| 115 |
+
# Smoking + radon synergy: multiplicative risk (WHO)
|
| 116 |
+
risk_mult = (cumulative_exposure / 500) * (5.0 if smoking else 1.0)
|
| 117 |
+
|
| 118 |
+
# Lung cancer (WHO: radon = second leading cause)
|
| 119 |
+
lung_cancer = int(age >= 40 and rng.random() < np.clip(
|
| 120 |
+
params["lung_cancer_base"] * risk_mult, 0, 0.05))
|
| 121 |
+
|
| 122 |
+
# Respiratory symptoms
|
| 123 |
+
chronic_cough = int(rng.random() < np.clip(0.05 + risk_mult * 0.02, 0, 0.20))
|
| 124 |
+
dyspnoea = int(rng.random() < np.clip(0.04 + risk_mult * 0.01, 0, 0.15))
|
| 125 |
+
|
| 126 |
+
# Measurement & mitigation
|
| 127 |
+
radon_measured = int(rng.random() < params["measurement_pct"])
|
| 128 |
+
aware_of_radon = int(rng.random() < 0.05)
|
| 129 |
+
mitigation_installed = int(above_action_300 and radon_measured and rng.random() < 0.10)
|
| 130 |
+
ventilation_improved = int(radon_measured and rng.random() < 0.15)
|
| 131 |
+
sub_slab_depressurization = int(mitigation_installed and rng.random() < 0.20)
|
| 132 |
+
|
| 133 |
+
# Building characteristics
|
| 134 |
+
sealed_floor = int(rng.random() < 0.30)
|
| 135 |
+
cracks_in_floor = int(rng.random() < 0.40)
|
| 136 |
+
uranium_geology = int(setting in ("underground_mine", "rural_granite", "mining_town") and
|
| 137 |
+
rng.random() < 0.30)
|
| 138 |
+
|
| 139 |
+
any_health_effect = int(lung_cancer or chronic_cough or dyspnoea)
|
| 140 |
+
|
| 141 |
+
record = {
|
| 142 |
+
"record_id": f"{name[:3].upper()}-{idx:05d}",
|
| 143 |
+
"scenario": name,
|
| 144 |
+
"year": year,
|
| 145 |
+
"setting": setting,
|
| 146 |
+
"age": age,
|
| 147 |
+
"sex": sex,
|
| 148 |
+
"building_type": building_type,
|
| 149 |
+
"floor_level": floor_level,
|
| 150 |
+
"ventilation_poor": ventilation_poor,
|
| 151 |
+
"radon_bqm3": round(radon_bqm3, 1),
|
| 152 |
+
"above_who_100": above_who_100,
|
| 153 |
+
"above_action_300": above_action_300,
|
| 154 |
+
"hours_indoors_day": round(hours_indoors_day, 1),
|
| 155 |
+
"exposure_years": exposure_years,
|
| 156 |
+
"cumulative_exposure": round(cumulative_exposure, 0),
|
| 157 |
+
"smoking": smoking,
|
| 158 |
+
"lung_cancer": lung_cancer,
|
| 159 |
+
"chronic_cough": chronic_cough,
|
| 160 |
+
"dyspnoea": dyspnoea,
|
| 161 |
+
"radon_measured": radon_measured,
|
| 162 |
+
"aware_of_radon": aware_of_radon,
|
| 163 |
+
"mitigation_installed": mitigation_installed,
|
| 164 |
+
"ventilation_improved": ventilation_improved,
|
| 165 |
+
"sealed_floor": sealed_floor,
|
| 166 |
+
"cracks_in_floor": cracks_in_floor,
|
| 167 |
+
"uranium_geology": uranium_geology,
|
| 168 |
+
"any_health_effect": any_health_effect,
|
| 169 |
+
}
|
| 170 |
+
records.append(record)
|
| 171 |
+
|
| 172 |
+
return pd.DataFrame(records)
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
def main():
|
| 176 |
+
output_dir = Path("data")
|
| 177 |
+
output_dir.mkdir(parents=True, exist_ok=True)
|
| 178 |
+
for idx, (name, params) in enumerate(SCENARIOS.items()):
|
| 179 |
+
df = _simulate_scenario(name, params, SEED + idx * 211)
|
| 180 |
+
df.to_csv(output_dir / SCENARIO_FILES[name], index=False)
|
| 181 |
+
print(f"Saved {name} -> {SCENARIO_FILES[name]}")
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
if __name__ == "__main__":
|
| 185 |
+
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,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Validate synthetic radon & indoor radiation exposure 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 |
+
"granite_geology_rural": "radon_granite_rural.csv",
|
| 12 |
+
"urban_residential": "radon_urban_residential.csv",
|
| 13 |
+
"occupational_underground": "radon_occupational.csv",
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
COLORS = {"granite_geology_rural": "#e6550d", "urban_residential": "#756bb1", "occupational_underground": "#31a354"}
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def load_data() -> pd.DataFrame:
|
| 20 |
+
frames = []
|
| 21 |
+
for scenario, filename in SCENARIO_FILES.items():
|
| 22 |
+
df = pd.read_csv(Path("data") / filename)
|
| 23 |
+
frames.append(df)
|
| 24 |
+
return pd.concat(frames, ignore_index=True)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def plot_validation(df: pd.DataFrame, output_path: Path) -> None:
|
| 28 |
+
fig, axes = plt.subplots(4, 2, figsize=(14, 16))
|
| 29 |
+
axes = axes.flatten()
|
| 30 |
+
|
| 31 |
+
for s in SCENARIO_FILES:
|
| 32 |
+
subset = df[df["scenario"] == s]
|
| 33 |
+
axes[0].hist(subset["radon_bqm3"], bins=40, alpha=0.5, color=COLORS[s], label=s, range=(0, 800))
|
| 34 |
+
axes[0].axvline(100, color="red", ls="--", lw=1, label="WHO 100 Bq/m³")
|
| 35 |
+
axes[0].axvline(300, color="orange", ls="--", lw=1, label="Action 300 Bq/m³")
|
| 36 |
+
axes[0].set_title("Indoor Radon Distribution (Bq/m³)")
|
| 37 |
+
axes[0].legend(fontsize=6)
|
| 38 |
+
|
| 39 |
+
exc_cols = ["above_who_100", "above_action_300"]
|
| 40 |
+
exc = df.groupby("scenario")[exc_cols].mean() * 100
|
| 41 |
+
exc.plot(kind="bar", ax=axes[1])
|
| 42 |
+
axes[1].set_title("WHO & Action Level Exceedance (%)")
|
| 43 |
+
axes[1].legend(fontsize=7)
|
| 44 |
+
|
| 45 |
+
health_cols = ["lung_cancer", "chronic_cough", "dyspnoea"]
|
| 46 |
+
health = df.groupby("scenario")[health_cols].mean() * 100
|
| 47 |
+
health.plot(kind="bar", ax=axes[2])
|
| 48 |
+
axes[2].set_title("Health Outcomes (%)")
|
| 49 |
+
axes[2].legend(fontsize=7)
|
| 50 |
+
|
| 51 |
+
for s in SCENARIO_FILES:
|
| 52 |
+
subset = df[df["scenario"] == s]
|
| 53 |
+
axes[3].scatter(subset["radon_bqm3"], subset["lung_cancer"],
|
| 54 |
+
s=4, alpha=0.05, color=COLORS[s], label=s)
|
| 55 |
+
axes[3].set_title("Radon vs Lung Cancer")
|
| 56 |
+
axes[3].legend(fontsize=7)
|
| 57 |
+
|
| 58 |
+
bld = df.groupby(["scenario", "building_type"]).size().groupby(level=0).apply(lambda s: s / s.sum())
|
| 59 |
+
bld.unstack().plot(kind="bar", stacked=True, ax=axes[4])
|
| 60 |
+
axes[4].set_title("Building Type Distribution")
|
| 61 |
+
axes[4].legend(fontsize=5)
|
| 62 |
+
|
| 63 |
+
flr = df.groupby(["scenario", "floor_level"]).size().groupby(level=0).apply(lambda s: s / s.sum())
|
| 64 |
+
flr.unstack().plot(kind="bar", stacked=True, ax=axes[5])
|
| 65 |
+
axes[5].set_title("Floor Level Distribution")
|
| 66 |
+
axes[5].legend(fontsize=7)
|
| 67 |
+
|
| 68 |
+
risk_cols = ["ventilation_poor", "cracks_in_floor", "smoking", "uranium_geology"]
|
| 69 |
+
risk = df.groupby("scenario")[risk_cols].mean() * 100
|
| 70 |
+
risk.plot(kind="bar", ax=axes[6])
|
| 71 |
+
axes[6].set_title("Risk Factors (%)")
|
| 72 |
+
axes[6].legend(fontsize=6)
|
| 73 |
+
|
| 74 |
+
mit_cols = ["radon_measured", "aware_of_radon", "mitigation_installed", "ventilation_improved"]
|
| 75 |
+
mit = df.groupby("scenario")[mit_cols].mean() * 100
|
| 76 |
+
mit.plot(kind="bar", ax=axes[7])
|
| 77 |
+
axes[7].set_title("Measurement & Mitigation (%)")
|
| 78 |
+
axes[7].legend(fontsize=6)
|
| 79 |
+
|
| 80 |
+
plt.tight_layout()
|
| 81 |
+
fig.savefig(output_path, dpi=200)
|
| 82 |
+
plt.close(fig)
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
def main() -> None:
|
| 86 |
+
df = load_data()
|
| 87 |
+
plot_validation(df, Path("validation_report.png"))
|
| 88 |
+
print("Saved validation_report.png")
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
if __name__ == "__main__":
|
| 92 |
+
main()
|
validation_report.png
ADDED
|
Git LFS Details
|