-
Sakh's home screen, styled like a bahi-khata ledger, with consent notice and a "synthetic data" stamp.
-
Sakh's home screen, styled like a bahi-khata ledger, with a consent notice and a "synthetic data" stamp.
-
Applicant inputs: bill payments, recharge regularity, UPI income and savings habits. No gender, region or occupation.
-
Calibrated 300-900 Sakh score with a suggested loan tier and score band.
-
Why this score? SHAP shows which habits raised or lowered the estimate, in plain language.
-
"How to improve": the smallest realistic change in habits that moves an applicant up a score band.
Inspiration
A bahi-khata is the red cloth ledger Indian shopkeepers use to record who paid, who owes and who can be trusted. For a gig driver, a street vendor or a farmer with no bank history, that kind of trust is real, but no credit bureau can see it. Formal credit files skip these people. Their UPI inflows, electricity bills and mobile recharges already show how reliable they are. I wanted to build a scorer that reads those signals and doesn't leave the applicant guessing afterwards.
"Sakh" (साख) means credit, reputation and standing.
What it does
Sakh takes behavioural data and returns four things:
- A score from 300 to 900 with a suggested loan range, built from bill-payment streaks, recharge regularity, UPI inflow consistency, income volatility, savings-like balance and informal loan burden.
- A plain-language reason for every score, using SHAP to say which habits helped or hurt.
- A "next entry" plan. If the applicant is in a low band, Sakh searches only the habits they can actually change (not gender, region or occupation) and finds the smallest change that moves them up a band.
- A fairness audit with Fairlearn, showing approval rates and error rates by gender, region and occupation, before and after mitigation.
The UI is styled like a ledger: parchment, ink, vermilion cloth and a brass gauge.
How I built it
I built it solo in the 48-hour window, in Python.
- I generated about 5,000 synthetic applicants. I deliberately built in a historical bias: women and rural applicants have lower repayment labels and lower UPI inflows, so the audit has something real to find.
- I trained a logistic regression baseline and an XGBoost model, then calibrated the probabilities. The held-out test AUC is [AUC] for XGBoost against [AUC] for the baseline.
- I converted the repayment probability into a 300 to 900 score with loan tiers.
- I added SHAP explanations and a recourse search that only changes actionable features.
- I audited the model with Fairlearn and mitigated it. The gap in approval rates between rural and urban applicants went from [X] to [Y].
- I built the app in Streamlit and Plotly.
Demographic columns are never model inputs. They are used only for the audit.
Challenges I ran into
- Making the recourse advice realistic. An unconstrained search suggests things like "raise your UPI income by ₹40,000". I had to limit the search to habits a person can change and cap each change at realistic bounds.
- Fairness is not a free lunch. Dropping demographic columns doesn't remove bias, because UPI inflow and similar features act as proxies. Mitigation narrowed the gap but cost some accuracy, and I show that trade-off in the app instead of hiding it.
- Readable UI. My first version had white text on cream, so I redesigned the whole interface around the ledger idea with proper contrast.
Accomplishments that I'm proud of
- A scorer that tells a rejected applicant exactly what to do next, not just "declined".
- A fairness audit that finds a bias I planted and shows how mitigation changes the outcome.
- A complete, deployed prototype built solo in under two days.
What I learned
Explainability and fairness change the design from the start. Which features you allow, how you word a reason and what you let someone act on all matter as much as the model's AUC.
What's next
- Test on anonymised real-world data with proper consent.
- Add vernacular (Hindi and other regional language) explanations and an SMS or voice interface.
- Add stronger fairness constraints and regular drift monitoring.
- Pilot with a microfinance partner and get feedback from loan officers.
Disclaimer: All data is synthetic. Sakh is a decision-support prototype, not a real lending system.
AI tools used: Claude (Anthropic) and GitHub Copilot helped with planning, code and UI.
Built With
- fairlearn
- pandas
- plotly
- python
- scikit-learn
- shap
- streamlit
- xgboost