credit-risk-prediction-kenya
# Credit Risk Prediction for Underbanked Borrowers in Kenya
## Project Overview
This project focuses on predicting whether a borrower is likely to default on a loan using machine learning. The aim is to demonstrate how behavioural financial data can be used to support credit risk assessment, especially for people who may not have a formal banking or credit history.
To achieve this, we built and compared two machine learning models: Logistic Regression and XGBoost. The final model was deployed using Streamlit, allowing users to enter borrower information and receive a predicted credit risk.
## Problem Statement
Many people in Kenya struggle to access loans because they lack traditional credit histories or collateral. As a result, they are often excluded from formal lending services.
This project investigates whether borrower behaviour, such as payment history, debt ratio, and credit utilization, can be used to predict loan default. Such an approach could help financial institutions make more informed lending decisions while promoting greater financial inclusion.
## Dataset
The project uses the **Give Me Some Credit** dataset from Kaggle, which contains **150,000 borrower records** and **11 features** related to borrowers' financial behaviour.
Some of the main variables include:
- Revolving credit utilization
- Age
- Monthly income
- Debt ratio
- Number of dependents
- History of late payments
The target variable is **SeriousDlqin2yrs**, where:
- **0** = No default
- **1** = Default within two years
Although the dataset is not from Kenya, it provides a suitable benchmark for demonstrating behaviour-based credit risk prediction.
## Project Workflow
The project follows the standard data science process:
1. Data loading and inspection
2. Data cleaning and preprocessing
3. Exploratory Data Analysis (EDA)
4. Feature engineering
5. Model training
6. Model evaluation
7. Model interpretation using SHAP
8. Deployment with Streamlit
## Feature Engineering
To i …