Introduction
In many emerging markets, traditional banking data is scarce, but mobile money usage is high. Services like M-Pesa,G-Money, GCash,Monzo, Revault to mension but a few have become financial lifelines, yet users still struggle to access credit due to the absence of formal credit histories.
As a DevOps and ML practitioner passionate about practical AI solutions, I built an open-source project that uses mobile money transaction data to generate explainable credit scores, even in low-data environments.
In this post, I’ll walk through how it works, the tools I used, and how you can replicate or build upon it.
Problem: Credit Scoring Without Traditional Data
In many African and emerging economies:
- Credit bureaus don’t cover most of the population
- Many people operate entirely through mobile money
- Lenders lack reliable tools for assessing borrower risk
That’s where machine learning and alternative data sources like transaction frequency, balance trends, airtime top-ups, and withdrawal patterns come into play.
Tools & Stack
Python & Jupyter Notebooks for model prototyping
Pandas & Scikit-learn for feature engineering and modeling
KMeans Clustering to segment users
Decision Trees for transparency
SHAP & LIME for explainability
Everything is open-sourced and designed to be easy to run on a laptop, no cloud costs, no heavy dependencies.
How the Model Works
Data Simulation
Synthetic transaction logs modeled after real-world M-Pesa usage
Columns include transaction types, amounts, frequencies, and balance history
Feature Engineering
Metrics:
Number of transactions per month
Average balance duration
Variance in top-up behavior
Frequency of peer-to-peer transfers
KMeans Clustering
Decision Tree
Explainability
Why This Matters
AI must solve real problems for real people.
Enable fintechs and startups to assess borrower risk affordably
Promote financial inclusion through technology
Encourage transparent machine learning in sensitive domains like credit
Try it your self:
Follow the Github Link below to fork the repo, clone to reuse the code.
https://github.com/cliffordisaboke/mpesa-credit-score-demo
Don't forget to star the repo if the code is useful to you!