Explainable machine learning framework for county-level cholera early warning in Kenya.
# Cholera Early Warning in Kenya
This repository contains the reproducible analysis for the MSc thesis:
**Explainable Machine Learning Models for Early Warning of Cholera Outbreaks in Kenya Using Climate and Epidemiological Indicators**
The study develops and evaluates a county-level early-warning framework for predicting cholera outbreaks in Kenya two to four weeks in advance using epidemiological, climatic, environmental, demographic and water, sanitation and hygiene (WASH) indicators.
## Study Overview
The analysis covers all 47 counties in Kenya using weekly observations from 2015 to 2025.
The study aimed to:
- describe temporal patterns in cholera cases, deaths, incidence and outbreak occurrence;
- compare ARIMA, Random Forest and XGBoost for three-week-ahead outbreak prediction;
- evaluate outbreak detection and false-alert burden;
- identify important predictive contributors using SHAP;
- assess robustness across two-, three- and four-week prediction horizons.
The primary analytical outbreak definition was a county-week with at least five reported cholera cases.
A broader sensitivity definition additionally classified county-weeks with incidence of at least one case per 100,000 population as outbreaks.
## Data Structure
The complete surveillance panel contained:
- 47 counties;
- 574 weekly observations per county;
- 26,978 county-week observations;
- 23 predictors used in the machine-learning analysis.
After removing observations with structurally unavailable lagged predictors or future outcomes, the primary three-week modelling sample contained:
**26,508 county-weeks**
The predictor domains included:
- epidemiological surveillance;
- temporal indicators;
- rainfall and temperature;
- lagged climatic variables;
- environmental indicators;
- population;
- WASH vulnerability.
## Prediction Framework
For county \(i\) at epidemiological week \(t\), the study estimated the probability of a future outbreak at prediction horizon \(h\):
\[
P(Y^{(h) …