Fraud detection demo
Score real card transactions with the trained fraud model, running in your browser. Change a transaction to see how the model reacts, then set the alert policy and see what fraud would cost the business across every held-out transaction.
Fraud score
–
–
Pattern anomaly
–
autoencoder error vs. a typical purchase
Fraud cost, test set
–
–
Total cost by alert threshold
- Model
- No model
Loading the model…
Line chart of total cost (alert reviews plus missed fraud) on the held-out test set at each alert threshold, compared with the cost of having no model.
| At this threshold | Test set |
|---|
How it works
- The model: an autoencoder trained only on legitimate purchases measures how unusual each transaction looks. That score joins the card features in XGBoost and LightGBM, and a logistic regression combines the two.
- The cost: every alert costs a review, and every missed fraud costs its amount. The cheapest threshold balances the two, and it moves when reviews get more expensive.
- Try: take a fraud and slide "How unusual it looks" toward 0% to see where the model stops flagging it, or raise the review cost and watch the cheapest threshold climb.
Data: the public European cardholder dataset (284,807 transactions, 0.17% fraud). The threshold was chosen on a validation split; costs here are on the separate test set. Read the case study or the code.