ClimaSafe · early warning · ML

Heat and cold risk warning
before the day arrives.

A personalized early-warning system for heat and cold stress. It estimates your cardiovascular risk level (safe / caution / danger) for any Spanish location, day and hour, from thermal comfort indices and a conformal-weighted ensemble of XGBoost (heat), RandomForest (cold) and an LSTM with province embedding, and then personalises the population risk with literature-based individual factors — age, sex, body fat, comorbidities, medication, acclimatisation, activity. Live forecast from Open-Meteo; target built from MoMo mortality attributable to heat (X30) and cold (X31).

01
problem What it solves
Temperature extremes have a direct, lagged effect on mortality. The system models the relationship between daily meteorological variables and mortality attributed to heat (X30) and cold (X31), then produces province-day risk levels. It is an early-warning system: it prioritises not missing risky days (recall) over avoiding false alarms. On top of the population risk, it computes an individual risk — a 72-year-old with diabetes, antipsychotics and no acclimatisation is not a 25-year-old runner — by applying multiplicative factors extracted from the epidemiological literature, with a physical safety override when the Heat Index or Wind Chill crosses dangerous thresholds.
Models
XGBoost (heat) · RandomForest (cold) · LSTM province_hybrid · thermal indices
Data
ERA5 (train) · Open-Meteo (live) · AEMET · OpenUV · MoMo mortality
Scope
Personalized risk per person, province, day and hour · heat and cold
02
approach Modelling
Target: mortality percentiles from MoMo (X30/X31), computed per province so small provinces are not penalised.
Features: thermal comfort indices (Heat Index, WBGT, Wind Chill) at the riskiest hour, plus the daily 24 h distribution and temporal persistence (lags, rolling means, consecutive cold-day streaks).
Split by date, not random: avoids leaking days of the same wave between train and test.
Selection metric: recall of the risk classes (Rec_riesgo), not accuracy.
Tracking: MLflow with temporal cross-validation by year.
Ensemble: conformal-weighted average — each model is weighted by the size of its conformal prediction set (the smaller the set, the more it is trusted), with isotonic calibration for the cold channel.
Personalisation: multiplicative factors from the epidemiological literature (age, sex, body fat, acclimatisation, comorbidities, medication, social situation, activity intensity, duration and hour, wind chill saturation, cumulative fatigue), capped to avoid double counting, plus physical overrides by Heat Index / Wind Chill.
03
results Real numbers
Rec_riesgo (calibrated thresholds) XGBoost 0.668 (heat) · RF 0.612 (cold) · LSTM 0.737 heat / 0.708 cold.
Beyond the classifier, the project delivers conformal prediction, individual risk personalisation, per-hour risk profiles, a weekly forecast with conformal confidence bands, km² risk maps, SHAP explainability, counterfactual recommendations, a Telegram bot, MCP servers for AI assistants, RAG over the documentation, and a fine-tuned Qwen3 LLM (LoRA) for natural-language answers — all built as part of the ANFAIA Summer Grants 2026 and generated from the dskit template.