Datasets:
Upload folder using huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- tabular-classification
|
| 5 |
+
- tabular-regression
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- climate
|
| 10 |
+
- environment
|
| 11 |
+
- africa
|
| 12 |
+
- synthetic-data
|
| 13 |
+
- sub-saharan-africa
|
| 14 |
+
- climate-vulnerability
|
| 15 |
+
- climate-adaptation
|
| 16 |
+
- climate-risk
|
| 17 |
+
size_categories:
|
| 18 |
+
- 10K<n<100K
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# Climate Vulnerability and Exposure - Africa
|
| 22 |
+
|
| 23 |
+
A comprehensive synthetic dataset assessing climate vulnerability, exposure indices, and adaptive capacity across Sub-Saharan African countries.
|
| 24 |
+
|
| 25 |
+
## Dataset Description
|
| 26 |
+
|
| 27 |
+
This dataset provides detailed records of climate vulnerability assessments across 15 Sub-Saharan African countries. It includes exposure metrics, hazard probabilities, adaptive capacity indicators, and climate policy frameworks. The data enables analysis of climate-nutrition linkages through malnutrition burden stratification.
|
| 28 |
+
|
| 29 |
+
### Key Statistics
|
| 30 |
+
|
| 31 |
+
| Metric | Value |
|
| 32 |
+
|--------|-------|
|
| 33 |
+
| Total Records | 14,998 |
|
| 34 |
+
| Countries Covered | 15 |
|
| 35 |
+
| Time Period | 2018-2025 |
|
| 36 |
+
| Files | 3 (high_burden, moderate_burden, low_burden) |
|
| 37 |
+
| Features | 29 |
|
| 38 |
+
|
| 39 |
+
### Countries Included
|
| 40 |
+
DRC, Ethiopia, Ghana, Kenya, Malawi, Mali, Mozambique, Niger, Nigeria, Rwanda, Senegal, South Africa, Tanzania, Uganda, Zambia
|
| 41 |
+
|
| 42 |
+
## Column Descriptions
|
| 43 |
+
|
| 44 |
+
| Column | Type | Description |
|
| 45 |
+
|--------|------|-------------|
|
| 46 |
+
| record_id | string | Unique identifier (CLIM_XXXXXX) |
|
| 47 |
+
| country | string | African country name |
|
| 48 |
+
| year | int | Year of observation (2018-2025) |
|
| 49 |
+
| climate_zone | string | Climate classification |
|
| 50 |
+
| geographic_exposure_index | float | Geographic exposure to climate hazards (0-1) |
|
| 51 |
+
| coastal_proximity | int | Binary coastal proximity (0/1) |
|
| 52 |
+
| elevation_category | string | Elevation classification |
|
| 53 |
+
| temperature_anomaly_c | float | Temperature deviation from baseline (°C) |
|
| 54 |
+
| precipitation_variability_pct | float | Precipitation variability (%) |
|
| 55 |
+
| extreme_heat_days_year | int | Annual extreme heat days |
|
| 56 |
+
| heat_stress_index | float | Heat stress composite index |
|
| 57 |
+
| drought_probability | float | Probability of drought (0-1) |
|
| 58 |
+
| flood_probability | float | Probability of flooding (0-1) |
|
| 59 |
+
| climate_hazard_index | float | Composite hazard index (0-1) |
|
| 60 |
+
| gdp_per_capita_usd | float | GDP per capita (USD) |
|
| 61 |
+
| agriculture_gdp_share_pct | float | Agriculture share of GDP (%) |
|
| 62 |
+
| infrastructure_quality_index | float | Infrastructure quality (0-1) |
|
| 63 |
+
| healthcare_access_index | float | Healthcare access (0-1) |
|
| 64 |
+
| early_warning_coverage_pct | float | Early warning system coverage (%) |
|
| 65 |
+
| social_protection_coverage_pct | float | Social protection coverage (%) |
|
| 66 |
+
| adaptive_capacity_index | float | Overall adaptive capacity (0-1) |
|
| 67 |
+
| climate_policy_strength | float | Climate policy strength (0-1) |
|
| 68 |
+
| ndc_ambition_score | float | NDC ambition score (0-1) |
|
| 69 |
+
| climate_finance_access_million_usd | float | Climate finance accessed (million USD) |
|
| 70 |
+
| vulnerability_index | float | Composite vulnerability index (0-1) |
|
| 71 |
+
| exposure_score | float | Climate exposure score (0-1) |
|
| 72 |
+
| risk_category | string | Risk classification |
|
| 73 |
+
| population_at_risk_millions | float | Population at climate risk (millions) |
|
| 74 |
+
| potential_economic_loss_pct_gdp | float | Potential economic loss (% GDP) |
|
| 75 |
+
|
| 76 |
+
### Climate Zones
|
| 77 |
+
- tropical_wet, tropical_dry, semi_arid, arid, mediterranean, highland
|
| 78 |
+
|
| 79 |
+
### Risk Categories
|
| 80 |
+
- Low, Moderate, High, Very_High
|
| 81 |
+
|
| 82 |
+
## Usage Example
|
| 83 |
+
|
| 84 |
+
```python
|
| 85 |
+
import pandas as pd
|
| 86 |
+
|
| 87 |
+
# Load high burden dataset
|
| 88 |
+
df = pd.read_csv('climate_vulnerability_exposure_africa_high_burden.csv')
|
| 89 |
+
|
| 90 |
+
# Analyze vulnerability by country
|
| 91 |
+
vulnerability = df.groupby('country')['vulnerability_index'].mean()
|
| 92 |
+
print(vulnerability.sort_values(ascending=False))
|
| 93 |
+
|
| 94 |
+
# Filter very high risk areas
|
| 95 |
+
very_high_risk = df[df['risk_category'] == 'Very_High']
|
| 96 |
+
|
| 97 |
+
# Correlation analysis
|
| 98 |
+
correlation = df[['adaptive_capacity_index', 'vulnerability_index']].corr()
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
## Research Sources
|
| 102 |
+
|
| 103 |
+
This synthetic dataset is inspired by and aligned with data from:
|
| 104 |
+
- [ND-GAIN Country Index](https://gain.nd.edu/our-work/country-index/)
|
| 105 |
+
- [INFORM Risk Index](https://drmkc.jrc.ec.europa.eu/inform-index)
|
| 106 |
+
- [World Bank Climate Change Knowledge Portal](https://climateknowledgeportal.worldbank.org/)
|
| 107 |
+
- [IPCC Climate Reports](https://www.ipcc.ch/)
|
climate_vulnerability_exposure_africa_high_burden.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
climate_vulnerability_exposure_africa_low_burden.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
climate_vulnerability_exposure_africa_moderate_burden.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
generate_dataset.py
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Climate Vulnerability and Exposure Dataset Generator for Africa
|
| 3 |
+
|
| 4 |
+
================================================================================
|
| 5 |
+
PARAMETER EVIDENCE TABLE
|
| 6 |
+
================================================================================
|
| 7 |
+
| Parameter | Value/Range | Source |
|
| 8 |
+
|------------------------------|-----------------------|--------------------------|
|
| 9 |
+
| Africa warming rate | 1.5x global average | IPCC AR6 2023 |
|
| 10 |
+
| Extreme heat events increase | 4x since 1990 | WMO State of Climate |
|
| 11 |
+
| Climate-related displacement | 7M annually | IDMC 2024 |
|
| 12 |
+
| Agricultural GDP loss risk | 10-15% by 2050 | World Bank 2023 |
|
| 13 |
+
| Adaptive capacity index | 0.25-0.45 (Africa) | ND-GAIN 2024 |
|
| 14 |
+
| Climate finance gap | $250B annually | AfDB 2024 |
|
| 15 |
+
| Coastal flood exposure | 54M people | WRI Aqueduct 2024 |
|
| 16 |
+
| Rainfall variability | ±40% from mean | ClimDev-Africa 2024 |
|
| 17 |
+
================================================================================
|
| 18 |
+
|
| 19 |
+
DAG Structure:
|
| 20 |
+
geographic_exposure -> climate_hazard_probability -> vulnerability_index
|
| 21 |
+
economic_capacity -> adaptive_capacity
|
| 22 |
+
infrastructure_resilience -> exposure_score
|
| 23 |
+
institutional_capacity -> response_capability
|
| 24 |
+
temperature_trends -> heat_stress_index
|
| 25 |
+
precipitation_patterns -> drought_flood_risk
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
import numpy as np
|
| 29 |
+
import pandas as pd
|
| 30 |
+
from pathlib import Path
|
| 31 |
+
|
| 32 |
+
COUNTRIES = [
|
| 33 |
+
"Kenya", "Uganda", "Nigeria", "Ghana", "Tanzania", "Ethiopia",
|
| 34 |
+
"Malawi", "Zambia", "Senegal", "Rwanda", "Niger", "Mali",
|
| 35 |
+
"DRC", "Mozambique", "South Africa"
|
| 36 |
+
]
|
| 37 |
+
|
| 38 |
+
YEARS = list(range(2018, 2026))
|
| 39 |
+
|
| 40 |
+
COUNTRY_VULNERABILITY_BASE = {
|
| 41 |
+
"Niger": {"exposure": 0.85, "adaptive_capacity": 0.25},
|
| 42 |
+
"Mali": {"exposure": 0.82, "adaptive_capacity": 0.28},
|
| 43 |
+
"DRC": {"exposure": 0.75, "adaptive_capacity": 0.30},
|
| 44 |
+
"Mozambique": {"exposure": 0.78, "adaptive_capacity": 0.32},
|
| 45 |
+
"Ethiopia": {"exposure": 0.72, "adaptive_capacity": 0.35},
|
| 46 |
+
"Malawi": {"exposure": 0.70, "adaptive_capacity": 0.33},
|
| 47 |
+
"Tanzania": {"exposure": 0.65, "adaptive_capacity": 0.38},
|
| 48 |
+
"Uganda": {"exposure": 0.62, "adaptive_capacity": 0.40},
|
| 49 |
+
"Kenya": {"exposure": 0.58, "adaptive_capacity": 0.42},
|
| 50 |
+
"Zambia": {"exposure": 0.60, "adaptive_capacity": 0.40},
|
| 51 |
+
"Ghana": {"exposure": 0.50, "adaptive_capacity": 0.48},
|
| 52 |
+
"Senegal": {"exposure": 0.55, "adaptive_capacity": 0.45},
|
| 53 |
+
"Nigeria": {"exposure": 0.52, "adaptive_capacity": 0.44},
|
| 54 |
+
"Rwanda": {"exposure": 0.48, "adaptive_capacity": 0.52},
|
| 55 |
+
"South Africa": {"exposure": 0.42, "adaptive_capacity": 0.58},
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
CLIMATE_ZONES = ["arid", "semi_arid", "tropical_wet", "tropical_dry", "mediterranean", "highland"]
|
| 59 |
+
|
| 60 |
+
def generate_dataset(scenario: str, n_samples: int, seed: int) -> pd.DataFrame:
|
| 61 |
+
rng = np.random.default_rng(seed)
|
| 62 |
+
|
| 63 |
+
burden_mod = {"low_burden": 0.7, "moderate_burden": 1.0, "high_burden": 1.4}[scenario]
|
| 64 |
+
|
| 65 |
+
countries = rng.choice(COUNTRIES, size=n_samples)
|
| 66 |
+
years = rng.choice(YEARS, size=n_samples)
|
| 67 |
+
|
| 68 |
+
data = {
|
| 69 |
+
"record_id": [f"CLIM_{i:06d}" for i in range(n_samples)],
|
| 70 |
+
"country": countries,
|
| 71 |
+
"year": years,
|
| 72 |
+
"climate_zone": rng.choice(CLIMATE_ZONES, size=n_samples,
|
| 73 |
+
p=[0.15, 0.25, 0.20, 0.20, 0.05, 0.15]),
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
zone = data["climate_zone"]
|
| 77 |
+
base_exposure = np.array([COUNTRY_VULNERABILITY_BASE[c]["exposure"] for c in countries])
|
| 78 |
+
base_adaptive = np.array([COUNTRY_VULNERABILITY_BASE[c]["adaptive_capacity"] for c in countries])
|
| 79 |
+
|
| 80 |
+
year_factor = (years - 2018) * 0.02 * burden_mod
|
| 81 |
+
data["geographic_exposure_index"] = np.clip(
|
| 82 |
+
base_exposure * (1 + year_factor) + rng.normal(0, 0.05, n_samples), 0.1, 1.0
|
| 83 |
+
).round(3)
|
| 84 |
+
|
| 85 |
+
data["coastal_proximity"] = rng.choice([0, 1], size=n_samples, p=[0.6, 0.4])
|
| 86 |
+
data["elevation_category"] = rng.choice(["lowland", "mid_elevation", "highland"],
|
| 87 |
+
size=n_samples, p=[0.4, 0.35, 0.25])
|
| 88 |
+
|
| 89 |
+
zone_temp_factor = {"arid": 1.2, "semi_arid": 1.1, "tropical_wet": 0.9,
|
| 90 |
+
"tropical_dry": 1.0, "mediterranean": 0.8, "highland": 0.7}
|
| 91 |
+
temp_factors = np.array([zone_temp_factor[z] for z in zone])
|
| 92 |
+
|
| 93 |
+
data["temperature_anomaly_c"] = np.clip(
|
| 94 |
+
(0.8 + year_factor) * temp_factors * rng.uniform(0.5, 1.5, n_samples), 0.2, 3.5
|
| 95 |
+
).round(2)
|
| 96 |
+
|
| 97 |
+
zone_precip_factor = {"arid": 1.3, "semi_arid": 1.2, "tropical_wet": 1.1,
|
| 98 |
+
"tropical_dry": 1.4, "mediterranean": 1.2, "highland": 1.0}
|
| 99 |
+
precip_factors = np.array([zone_precip_factor[z] for z in zone])
|
| 100 |
+
|
| 101 |
+
data["precipitation_variability_pct"] = np.clip(
|
| 102 |
+
25 + year_factor * 10 * precip_factors + rng.normal(0, 5, n_samples), 10, 60
|
| 103 |
+
).round(1)
|
| 104 |
+
|
| 105 |
+
data["extreme_heat_days_year"] = np.clip(
|
| 106 |
+
(20 + data["temperature_anomaly_c"] * 15) * burden_mod *
|
| 107 |
+
rng.uniform(0.8, 1.2, n_samples), 5, 150
|
| 108 |
+
).astype(int)
|
| 109 |
+
|
| 110 |
+
data["heat_stress_index"] = np.clip(
|
| 111 |
+
(data["temperature_anomaly_c"] / 2 + data["extreme_heat_days_year"] / 50) *
|
| 112 |
+
burden_mod, 0, 10
|
| 113 |
+
).round(2)
|
| 114 |
+
|
| 115 |
+
data["drought_probability"] = np.clip(
|
| 116 |
+
data["geographic_exposure_index"] * 0.5 +
|
| 117 |
+
data["precipitation_variability_pct"] / 200 +
|
| 118 |
+
rng.uniform(-0.1, 0.1, n_samples), 0, 1
|
| 119 |
+
).round(3)
|
| 120 |
+
|
| 121 |
+
data["flood_probability"] = np.clip(
|
| 122 |
+
(data["coastal_proximity"] * 0.2 +
|
| 123 |
+
data["precipitation_variability_pct"] / 150) *
|
| 124 |
+
burden_mod + rng.uniform(0, 0.15, n_samples), 0, 0.8
|
| 125 |
+
).round(3)
|
| 126 |
+
|
| 127 |
+
data["climate_hazard_index"] = np.clip(
|
| 128 |
+
(data["drought_probability"] * 0.4 +
|
| 129 |
+
data["flood_probability"] * 0.3 +
|
| 130 |
+
data["heat_stress_index"] / 20) * burden_mod, 0, 1
|
| 131 |
+
).round(3)
|
| 132 |
+
|
| 133 |
+
data["gdp_per_capita_usd"] = np.clip(
|
| 134 |
+
rng.exponential(3000, n_samples) * (1 - data["geographic_exposure_index"] * 0.5),
|
| 135 |
+
300, 15000
|
| 136 |
+
).astype(int)
|
| 137 |
+
|
| 138 |
+
data["agriculture_gdp_share_pct"] = np.clip(
|
| 139 |
+
30 - data["gdp_per_capita_usd"] / 500 + rng.normal(0, 5, n_samples), 5, 50
|
| 140 |
+
).round(1)
|
| 141 |
+
|
| 142 |
+
data["infrastructure_quality_index"] = np.clip(
|
| 143 |
+
base_adaptive * 0.8 + rng.normal(0, 0.1, n_samples), 0.1, 0.9
|
| 144 |
+
).round(3)
|
| 145 |
+
|
| 146 |
+
data["healthcare_access_index"] = np.clip(
|
| 147 |
+
base_adaptive * 0.9 + data["gdp_per_capita_usd"] / 20000 +
|
| 148 |
+
rng.normal(0, 0.1, n_samples), 0.1, 0.95
|
| 149 |
+
).round(3)
|
| 150 |
+
|
| 151 |
+
data["early_warning_coverage_pct"] = np.clip(
|
| 152 |
+
base_adaptive * 60 + rng.normal(10, 15, n_samples), 5, 90
|
| 153 |
+
).round(1)
|
| 154 |
+
|
| 155 |
+
data["social_protection_coverage_pct"] = np.clip(
|
| 156 |
+
data["gdp_per_capita_usd"] / 150 + rng.normal(5, 10, n_samples), 2, 60
|
| 157 |
+
).round(1)
|
| 158 |
+
|
| 159 |
+
data["adaptive_capacity_index"] = np.clip(
|
| 160 |
+
(data["infrastructure_quality_index"] * 0.3 +
|
| 161 |
+
data["healthcare_access_index"] * 0.25 +
|
| 162 |
+
data["early_warning_coverage_pct"] / 200 +
|
| 163 |
+
data["social_protection_coverage_pct"] / 150) +
|
| 164 |
+
rng.normal(0, 0.05, n_samples), 0.1, 0.95
|
| 165 |
+
).round(3)
|
| 166 |
+
|
| 167 |
+
data["climate_policy_strength"] = np.clip(
|
| 168 |
+
base_adaptive * 1.2 + rng.normal(0, 0.15, n_samples), 0.1, 0.9
|
| 169 |
+
).round(3)
|
| 170 |
+
|
| 171 |
+
data["ndc_ambition_score"] = np.clip(
|
| 172 |
+
data["climate_policy_strength"] * 0.8 + rng.uniform(0, 0.3, n_samples), 0.1, 1.0
|
| 173 |
+
).round(3)
|
| 174 |
+
|
| 175 |
+
data["climate_finance_access_million_usd"] = np.clip(
|
| 176 |
+
data["climate_policy_strength"] * 500 + rng.exponential(100, n_samples), 10, 2000
|
| 177 |
+
).astype(int)
|
| 178 |
+
|
| 179 |
+
data["vulnerability_index"] = np.clip(
|
| 180 |
+
(data["climate_hazard_index"] * 0.5 +
|
| 181 |
+
data["geographic_exposure_index"] * 0.3 +
|
| 182 |
+
(1 - data["adaptive_capacity_index"]) * 0.2) * burden_mod, 0, 1
|
| 183 |
+
).round(3)
|
| 184 |
+
|
| 185 |
+
data["exposure_score"] = np.clip(
|
| 186 |
+
(data["geographic_exposure_index"] + data["climate_hazard_index"]) / 2, 0, 1
|
| 187 |
+
).round(3)
|
| 188 |
+
|
| 189 |
+
data["risk_category"] = np.select(
|
| 190 |
+
[data["vulnerability_index"] < 0.3,
|
| 191 |
+
data["vulnerability_index"] < 0.5,
|
| 192 |
+
data["vulnerability_index"] < 0.7,
|
| 193 |
+
data["vulnerability_index"] < 0.85,
|
| 194 |
+
data["vulnerability_index"] >= 0.85],
|
| 195 |
+
["Very_Low", "Low", "Moderate", "High", "Very_High"]
|
| 196 |
+
)
|
| 197 |
+
|
| 198 |
+
data["population_at_risk_millions"] = np.clip(
|
| 199 |
+
data["vulnerability_index"] * 15 * burden_mod +
|
| 200 |
+
rng.exponential(2, n_samples), 0.5, 50
|
| 201 |
+
).round(2)
|
| 202 |
+
|
| 203 |
+
data["potential_economic_loss_pct_gdp"] = np.clip(
|
| 204 |
+
data["vulnerability_index"] * 20 + data["agriculture_gdp_share_pct"] / 5, 1, 25
|
| 205 |
+
).round(1)
|
| 206 |
+
|
| 207 |
+
return pd.DataFrame(data)
|
| 208 |
+
|
| 209 |
+
def main():
|
| 210 |
+
output_dir = Path(__file__).parent
|
| 211 |
+
|
| 212 |
+
scenarios = [
|
| 213 |
+
("low_burden", 4000, 42),
|
| 214 |
+
("moderate_burden", 5000, 43),
|
| 215 |
+
("high_burden", 6000, 44),
|
| 216 |
+
]
|
| 217 |
+
|
| 218 |
+
for scenario, n, seed in scenarios:
|
| 219 |
+
df = generate_dataset(scenario, n, seed)
|
| 220 |
+
output_file = output_dir / f"climate_vulnerability_exposure_africa_{scenario}.csv"
|
| 221 |
+
df.to_csv(output_file, index=False)
|
| 222 |
+
print(f"Generated {output_file}: {len(df)} records")
|
| 223 |
+
|
| 224 |
+
if __name__ == "__main__":
|
| 225 |
+
main()
|