Python code and analysis notebooks for the MSc thesis: "Promise or Peril? County-Level Evidence on Digital Loans and Financial Well-Being in Kenya Using Machine Learning" Strathmore University, 2026.
# Promise or Peril? County-Level Evidence on Digital Loans and Financial Well-Being in Kenya Using Machine Learning
## Overview
This repository contains the complete Python code and Google Colab
notebook supporting the MSc thesis submitted in partial fulfilment
of the requirements for the degree of Master of Science in
Mathematical Sciences and Risk Analytics at Strathmore University,
Nairobi, Kenya (2026).
**Author:** Esmie Awonteme Abaaluk
**Submission Year:** 2026
**GitHub:** Esmiedollar
---
## Thesis Abstract
The rapid expansion of digital lending in Kenya has transformed
access to credit, yet its implications for household financial
well-being remain contested. This study investigates whether
digital loans represent promise or peril for Kenyan households
using a rigorous risk analytics framework. Using nationally
representative FinAccess survey data, the study models the
probability of household financial distress as a function of
digital loan usage and socioeconomic characteristics. A binary
classification framework is adopted, beginning with
survey-weighted logistic regression, followed by Random Forest
and Gradient Boosting ensemble machine learning models. Model
performance is evaluated using AUC ROC and Brier Score metrics.
Predicted probabilities are aggregated to generate county-level
financial vulnerability maps across all 47 Kenyan counties. SHAP
explainability analysis is used to interpret model predictions.
The findings confirm that digital loan usage is significantly
associated with financial distress, with this association mediated
by underlying socioeconomic characteristics including income,
employment status, education, and health status.
---
## Repository Structure
```
digital_loans_financial_wellbeing_kenya/
│
├── python_code_Esmie.ipynb ← Main analysis notebook
└── README.md
```
---
## Notebook Contents
The single notebook `python_code_Esmie.ipynb` contains the
complete end-to-end analysis, structured in the following
section …