Home / Work / Case study 01

EFPIP

Enterprise FinTech Payment Intelligence Platform

Can a model catch the fraud an existing rule misses, and can we trust it?

5 min readJump to the recommendations →

Domain
FinTech · payment fraud
Timeline
Jul – Aug 2026
Data
PaySim · 6.36M simulated payments
Stack
SQL Server · Python · SHAP · Power BI
Read as
The 30-second version
Problem
The existing rule caught only 16 of 8,213 frauds in 6.36M payments.
Result
A Random Forest catches 85% of fraud with 78% precision, after I removed four leaking features that had inflated recall to 99%.
Decision
Monitor high-value TRANSFER and CASH_OUT payments now; pilot model scoring with risk-tier checks next.
In the four kinds of analytics:DescriptivePredictivesee all four →
Guess first · then read on

The platform's existing rule was checked against 8,213 real frauds. What share do you think it caught?

Your guess
The data0.2%
16 of 8,213. About 0.2%.

Almost everything got through. That gap is why this project exists.

01 · The problem

Fraud is rare, expensive, and the rule was almost blind.

One payment in every 775 is fraud, but each one costs an average of 1.46 million. The platform's existing rule flagged only 16 of the 8,213 frauds in the data. A payments company needs to know where fraud happens, catch it without blocking good customers, and explain every decision to an analyst.

6.36Mpayments analyzed
8,213frauds, 1 in every 775
12.06Bvalue lost to fraud
16frauds the existing rule caught
Live simulation · fraud shown 40× more often than real so you can see it
Payments
0
Frauds
0
Caught
0
Missed
0
False alarms
0
The rule lets almost every fraud through.
02 · What the data says

SQL first: find where fraud lives.

Before any model, I loaded all 6.36M rows into a SQL Server star schema (one fact table, five dimensions, row counts reconciled from raw to fact) and investigated with T-SQL.

Finding 1

All fraud sits in two transaction types.

TRANSFER and CASH_OUT carry 100% of the 8,213 frauds. Three types have none, so monitoring can start narrow.

CASH_OUT
50.1%
TRANSFER
49.9%
PAYMENT
0%
CASH_IN
0%
DEBIT
0%
Finding 2

Fraud has no quiet hour.

Frauds by period of the day are almost flat, so monitoring has to run around the clock.

Afternoon
2,081
Morning
2,075
Night
2,054
Evening
2,003
◆
Finding 3: fraud is high-value. The average fraud is 1.46 million and the largest reach 10 million each, which is why the first recommendation is to monitor high-value TRANSFER and CASH_OUT payments.
03 · The honest model

99% recall looked perfect. That was the problem.

I trained three models (Logistic Regression, Random Forest, XGBoost) on an 80/20 split with SMOTE balancing on the training set. The first Random Forest caught 99.5% of frauds with 95.7% precision.

SHAP showed it leaned on four balance features. In PaySim, a fraudulent account's balance is often reset to zero whatever the amount: a quirk of the simulator, not real fraud behavior. The model was reading the answer, not learning fraud.

OriginBalanceChangeAmountToOriginBalanceRatioNewBalanceOrigBalanceGap

I removed them, retrained, and reported the lower numbers.

Random Forest
Original (inflated)After leakage check (reported)What was lost
ModelPrecisionRecallF1ROC-AUC
Logistic RegressionBaseline; far too many false alarms3.67%97.93%7.08%99.59%
Random Forest (original)Inflated by the simulator artifact95.72%99.45%97.55%99.88%
Random Forest, after leakage checkChampion, the numbers I report78.47%84.97%81.59%99.23%
XGBoostNot yet leakage-tested, so not reported as champion92.91%99.76%96.21%99.99%

Which model would you ship?

Percentages hide the cost. Here is what each model does on the real test set: 1,272,524 payments, 1,643 of them fraud.

Of 1,643 frauds

caught
missed
01,643 frauds

Alerts your analysts review

alerts in total
false alarms
02,000 alerts

Confusion matrix

The same model as a 2 × 2 grid: what really happened against what the model said.

Confusion matrix for the selected model
Model flags itModel lets it pass
Really fraudcaughtmissed
Really legitimatefalse alarmscorrectly left alone
Recall = caught ÷ all fraudsPrecision = caught ÷ all alerts

Counts are derived from each model's reported precision and recall on the 1,643 test frauds, and they reproduce those metrics exactly (Logistic Regression's false alarms ±60 from rounding). Source: model evaluation results and the leakage-sensitivity notebook in the EFPIP repo.

04 · How it works

Seven stages, from raw file to decision.

01
EngineerIngest, validate, clean; star schema with reconciled row counts
02
AnalysePayment, account, fraud and money-flow SQL
03
ScaleViews, stored procedures, window functions, CTEs
04
PredictFeatures, SMOTE, three models, leakage check
05
ExplainGlobal and per-transaction SHAP
06
ShowThree Power BI dashboards on the star schema
07
DecideNorth Star, KPI tree, 8 case studies
05 · The dashboards

Three views, three audiences.

Executives see volume and fraud rate, risk analysts see where and when fraud happens, and the explainable-AI page shows why the model flags a payment. Click any screen to enlarge it.

06 · What to do about it

Five recommendations, ranked by impact and effort.

North Star metric: fraud loss prevention, broken down in a KPI tree. Each recommendation was placed on an impact / effort grid so the team knows what to build first.

Low effort
Medium effort
High effort
High impact
Quick win · start here
Monitor high-value paymentsStart with TRANSFER and CASH_OUT, where all fraud occurs
Verify by risk levelStandard, extra monitoring, or identity check by score
Live fraud dashboardsTrends, hotspots and high-risk patterns for operations
Score every paymentRandom Forest alongside business rules
Medium impact
Watch high-risk accountsUnusual frequency or value
⚖
How I'd test it: a conceptual A/B test where control keeps today's verification and treatment routes payments by risk score, measured on fraud rate, fraud amount and high-value fraud. It stays conceptual because PaySim has no approval outcomes or customer-experience data.
07 · What this project taught me

The number I'm proudest of is the lower one.

Too good is a bug until proven otherwise.99% recall on fraud should raise questions, not celebrations. SHAP is what exposed it.
Explainability is a debugging tool.I used SHAP to explain the model to stakeholders, and it ended up explaining the model's mistake to me.
Start where the risk is.The SQL finding (two types, 100% of fraud) is worth more on day one than any model.
Limitations, stated plainly
  • PaySim is synthetic: no real identities, devices, geography or chargebacks.
  • Authorization rate and customer experience are out of scope.
  • XGBoost hasn't had the same leakage check yet.
What I'd do next
  • Run the leakage check on XGBoost.
  • Validate on real, non-simulated transactions.
  • Real-time scoring with drift monitoring.

Shortcuts

Press Esc to close