# African Credit Scoring Challenge — USIU-Africa Hackathon
Predicting the likelihood of loan default for customers in Kenya and Ghana.
**Platform:** Zindi — african-credit-scoring-challenge1
---
## Folder Structure
```
├── model.py # Full training and prediction pipeline
├── predictions.csv # Final submission file (ID + target)
├── README.md # This file
├── environment.txt # Python dependencies
│
│ (place these in the same folder before running)
├── Train.csv # Training data (from Zindi)
├── Test.csv # Test data (from Zindi)
└── economic_indicators.csv # FRED economic indicators (from Zindi)
```
---
## How to Run
### 1. Set up environment
```bash
pip install -r environment.txt
```
### 2. Place data files in the same folder as model.py
- `Train.csv`
- `Test.csv`
- `economic_indicators.csv`
All three are available on the Zindi competition data page.
### 3. Run the script
```bash
python model.py
```
This will print progress to the terminal and save two output files:
- `predictions.csv` — Zindi submission file (ID + target)
- `predictions with probabilities.csv` — same but with raw default probabilities
---
## Features Used
28 features across 5 groups:
**Loan financials (log-transformed)**
- `log_Total_Amount`, `log_Total_Amount_to_Repay`, `log_Amount_Funded_By_Lender`, `log_Lender_portion_to_be_repaid`
**Derived loan cost features**
- `repay_ratio` — Total_Amount_to_Repay / Total_Amount (how expensive is the loan?)
- `interest_amount` — Total_Amount_to_Repay minus Total_Amount
- `funded_ratio` — lender's share of the loan
- `Lender_portion_Funded`, `duration`, `loan_term_days`
**Multi-lender and customer signals**
- `num_lenders` — loans with 2 lenders default at 8.3% vs 1.4% for single-lender loans
- `is_new_customer` — new customers default at 21% vs 1.7% for repeat customers
- `customer_loan_count` — total loans per …