FraudLens

Credit Card Fraud Detection ยท Confusion Matrix Playground

Financial Services ยท AI Risk Model
Risk Officer lens: You care most about catching every fraud case. False negatives (missed fraud) cost real money. You'll tolerate some genuine transactions being flagged.
Flag as fraud when score โ‰ฅ 0.50
0.00 โ€” Catch all 1.00 โ€” Catch none
Precision Of all transactions the model flagged as fraud, what % were actually fraud? High precision = fewer innocent customers blocked.
โ€”
Of flagged txns, % truly fraud
Recall Of all actual fraud cases in the dataset, what % did the model catch? High recall = fewer frauds slipping through.
โ€”
Of all fraud, % caught
F1 Score A single number balancing both Precision and Recall. Closer to 100% = the model is good at catching fraud without over-blocking genuine customers.
โ€”
Harmonic mean
Accuracy Out of all 25 transactions, what % did the model decide correctly? Warning: accuracy can look high even if the model misses most fraud.
โ€”
Overall correct decisions
Confusion Matrix โ€” Live View
Rows = Model Decision  ยท  Columns = Ground Truth  ยท  Adjust threshold to watch cells shift
Actual Fraud
Actual Genuine
Model Flags Fraud
TP 0 Fraud correctly caught
โ€” money saved
FP 0 Genuine txn blocked
โ€” customer annoyed
Model Passes
FN 0 Fraud slipped through
โ€” money lost
TN 0 Genuine txn passed
โ€” correct, no cost
๐Ÿ“Š Model Insights
Fraud Loss (FN ร— cost) โ‚น0
Customer Friction (FP ร— cost) โ‚น0
Total Operational Cost โ‚น0
Fraud Saved (TP ร— avg fraud amt) โ‚น0
๐Ÿ“ Live Calculation Breakdown Updates with every change
๐Ÿ’ฐ Cost Calculations
Fraud Loss = FN ร— Cost/FN
= 0 ร— โ‚น0 โ‚น0

Friction = FP ร— Cost/FP
= 0 ร— โ‚น0 โ‚น0

Total Cost = Loss + Friction โ‚น0
= โ‚น0 + โ‚น0
๐Ÿ“Š Metric Calculations
Precision = TP รท (TP + FP)
= 0 รท (0 + 0) โ€”

Recall = TP รท (TP + FN)
= 0 รท (0 + 0) โ€”

F1 = 2 ร— P ร— R รท (P + R)
= 2 ร— โ€” ร— โ€” รท (โ€”) โ€”

Accuracy = (TP+TN) รท Total โ€”
= (0+0) รท 25
โœ… Fraud Saved Calculation
Fraud Saved = Sum of actual amounts of all caught fraud transactions (TP)
โ€” โ‚น0
Avg fraud amount = Total Saved รท TP caught = โ€”
Cost Curve โ€” Total Cost vs Threshold
Blue line = Fraud Loss ยท Orange line = Customer Friction ยท Yellow line = Total Cost ยท โ–ฒ = your current threshold
โ€”
Step 1 of 4
โ€”
โ€”
Live Transaction Pool 0 transactions
TXN ID Amount (โ‚น) True Label Fraud Score Model Decision Outcome
Threshold (ฮธ)
The sensitivity dial. If a transaction's fraud score is above this number, the model flags it. Lower = stricter, catches more fraud but also blocks more genuine customers.
True Positive (TP) โœ…
The model flagged a transaction as fraud โ€” and it actually was fraud. This is the ideal outcome. Money saved.
False Positive (FP) โš ๏ธ
The model flagged a genuine customer's transaction as fraud by mistake. The customer gets blocked and is frustrated. No money lost, but trust is damaged.
False Negative (FN) ๐Ÿšจ
The model missed a fraud transaction and let it through. The bank loses money. This is the most costly error in financial services.
True Negative (TN) โœ…
The model correctly let a genuine transaction through. No error, no cost. This is also a good outcome.
Precision
Out of every transaction the model flagged as fraud, how many were actually fraud? High precision = fewer innocent customers blocked.
Recall
Out of all real fraud cases, how many did the model catch? High recall = fewer frauds slipping through. Also called Sensitivity.
F1 Score
A single number that balances Precision and Recall. 100% is perfect. Useful when both false alarms and missed fraud are costly.
Accuracy
The percentage of all decisions (fraud + genuine) that were correct. Can be misleading โ€” a model that passes every transaction would be 60% accurate but catch zero fraud.
Confusion Matrix
A 2ร—2 table showing all four outcomes (TP, FP, FN, TN) at once. It tells you not just how many the model got right, but what kind of mistakes it made.
Stakeholder Persona
Two people, same data, different priorities. A Risk Officer wants to catch every fraud even if it means blocking some genuine customers. A CX Head wants to protect customer experience even if a little fraud slips through. Toggle between them to see how the same model looks through different eyes. Risk Officer uses ฮธ=0.35, strict, flags aggressively to minimise missed fraud. CX Head uses ฮธ=0.65, lenient, prioritises customer flow. These are illustrative values; in production, set by the bank's risk team.
Card / Channel Presets
Banks don't use one threshold for everything. A โ‚น90,000 jewellery card transaction gets scrutinised differently than a โ‚น50 UPI payment. These presets simulate real-world threshold strategies. High-Value cards use a low threshold (flag aggressively), Micro-txn/UPI uses a high threshold (flag rarely to avoid friction). High-Value Card ฮธ=0.25, Standard Card ฮธ=0.50, UPI/Micro-txn ฮธ=0.70, Debit Low-Risk ฮธ=0.88. Illustrative values; in production, calibrated from historical fraud rates and regulatory guidelines.
Cost Configuration
Cost per missed fraud (FN) = what the bank loses when fraud slips through โ€” investigation fees, chargeback processing, write-off. Cost per false block (FP) = what it costs to wrongly stop a genuine customer โ€” call centre handling, goodwill credits, churn risk. Change these values and watch the cost curve shift.
Fraud Score
A number between 0 and 1 the AI model assigns to every transaction. Closer to 1 = the model thinks it's very likely fraud. Closer to 0 = looks genuine. The threshold decides where to draw the line.
Model Decision
What the model actually does with the transaction โ€” either ๐Ÿšจ FRAUD (blocks it for review) or โœ“ PASS (approves it). Based purely on whether the fraud score is above or below your threshold.
Outcome
The result after comparing the model's decision against the ground truth. โœ“ Fraud caught (TP), โœ“ Genuine passed (TN), โœ— Fraud missed (FN), โœ— Genuine blocked (FP).