The live model was reading the outcome
The October audit found pct_late_payments counted arrears pay-offs, and post-default instalments sat in its denominator.
Credit decisioning for thin-file BNPL customers that bureaus can’t see, built on a synthetic portfolio I generated. Modelled, explained and governed. Built to pass a model risk review.
BNPL lenders serve people a credit bureau barely knows. A model for them has to do more than score well: it has to survive a model risk review, explain every decision and notice when the world moves.
Customers with thin credit files are hard to assess on conventional signals, which makes governance, explainability and responsible deployment matter more, not less.
So the project treats governance, monitoring, auditability and deployment as first-class engineering problems, with every major decision linked to published research or regulatory guidance, including PRA SS1/23.
No public dataset represented UK BNPL customers, so I built one. A simulator where default isn’t assigned to anyone in advance: it emerges from how each customer actually repays.
Each customer follows a repayment hazard process and reaches the CRR/EBA 90-days-past-due definition through actual delinquency. That keeps repayment history a genuine predictive signal, not a by-product of the label.
Generation separates published evidence, calibrated values and documented engineering assumptions, so the source and justification of every generated number stays explicit.
Checked for fidelity, utility and privacy under the FCA, ICO and Alan Turing Institute synthetic-data framework. Generator-only variables stay in the raw layer for audit and never reach the model.
Lesson. Generating synthetic data is easier than proving it is fit for purpose. Loading it into PostgreSQL with real constraints exposed an identifier collision that Python validation had passed.
My own simulator creates customers, orders and repayments, with default emerging from a repayment hazard process.
Built from scratch · 50k customersValidated on fidelity, utility and privacy, following the FCA, ICO and Alan Turing Institute framework.
Fidelity 8/8 · Privacy 2/2A constrained PostgreSQL schema and a 64-column feature store, built close to the data.
PostgreSQL · 13 model featuresThree models benchmarked; a Platt-calibrated XGBoost champion with a cutoff set as review-capacity policy.
MLflow · cutoff 0.0657The applicant sees the outcome, the reasons in their own figures and what could change it; a risk officer gets a review flag.
SHAP · plain EnglishPSI drift checks under Airflow, champion–challenger in the MLflow registry, and an approval gate with typed human confirmation.
Airflow · Model Registrypct_late_payments partly encoded the outcome. Removing it cost −0.0038 Gini, with a 95% CI of [−0.0148, +0.0079]: not distinguishable from zero. It was promoted through an evidence-bound validity override and a typed human confirmation.
A label set before the behaviour that should predict it produces features that can’t be trusted, however plausible the values look.
The threshold is a policy parameter of the decision engine, chosen on training-only out-of-fold predictions so that 15% of applications go to review. This synthetic lender has no loss or review-cost figures to price errors on, so the cutoff is tied to workload, and the 15% is a stated assumption. Where error costs can be estimated, pricing the threshold on them is the stronger method.
No server, no database, no endpoint exposed to strangers. Nothing was built on the converted model until it matched the champion: 41,604 customers, max difference 5.96e-08, zero decision flips.
Segment-aware thresholds are a Consumer Duty and governance decision, not a modelling one. The trade-off is published in the demo’s cutoff simulator instead.
| Metric | Stratified | Out-of-time |
|---|---|---|
| Gini | 0.5618 | 0.5611 |
| AUC | 0.7809 | 0.7806 |
| KS | 0.4712 | 0.4390 |
| Sent to review at cutoff | 15.9% | 11.9% |
| Defaults caught (recall) | 57.96% | 40.32% |
| Precision | 9.90% | 8.65% |
| Bad rate among those not reviewed | 1.36% | 1.73% |
How to read this. 41,604 customers with an observed outcome; default rate 2.72%. Precision is judged against that base rate, not against 100%. The riskiest 10% of customers hold 39% of all defaults (lift 3.93×). Recall drops out of time, so the cutoff is a trade-off a lender would revisit.
Discrimination barely moves between the stratified test set and later-originating customers, after the leaking feature was removed, even though removing it cost score.
At the cutoff, every defaulter with an established credit file is scored below it, on both splits, while thin-file customers carry most false alarms. The model still ranks risk within that segment; one shared probability scale is the problem. Segment treatment is an open governance decision.
The governed champion runs entirely in your browser on synthetic data. Nothing you type leaves the page, and the site re-checks itself against the Python model before every deploy.
The October audit found pct_late_payments counted arrears pay-offs, and post-default instalments sat in its denominator.
79.3% of the comparison population was also in the training reference, which pulls PSI towards zero. The logged runs were fixed snapshots, not a trend.
Validation in notebooks passed. Loading into PostgreSQL with real constraints exposed a collision in the identifiers.
In v2 the evidence said no three times, and each time I reported it rather than shipping the newer thing. A neural challenger lost, a streaming target was missed, and Spark lost to PostgreSQL at 2M customers. The tools were the test; the decisions are the result.
v1 was frozen at a Git tag and fingerprinted: model files, feature definitions, database row counts and columns, all 103 MLflow runs. CI checks it on every push. v2 writes only to its own schemas; the API, dashboard and Power BI still read v1.
It passed the Approval Gate’s integrity checks, but passing the gate is not winning. Stratified Gini 0.5329 against 0.5618, a 95% CI excluding zero. Out of time 0.5700 against 0.5611, a CI including zero: noise, not a win. It also misses every established-file defaulter, like the champion. More model complexity does not fix a problem in the data.
Kafka and PyFlink rebuilt the features live and matched the v1 feature store for 50,000 of 50,000 customers. I redesigned when the measurements showed my first design capped at about 340 events/s. The goal was 1,000/s; one laptop sustained about 360/s, written up as not achieved. Scores run in shadow mode: recorded, never used to decide, until the path is validated.
Every engine had to reproduce the feature store exactly (0 of 126 million values different at 2M customers) before its timings counted. At 2M, PostgreSQL took 211 s, pandas 302 s, Spark 354 s. Spark scaled best but did not pay off on one machine. No retraining on the new data: that needs its own feature and cutoff decisions.
The API on AWS ECS Fargate in London, IP-restricted, torn down the same day. Priced from AWS’s published rates at about $0.08 an hour, and paused on budget. Designed only, not deployed.
Status. All v2 work is tested locally on synthetic data or a simulated replay, with every number from a real run. Failed runs are kept in the v2 decision log.