MACHINE LEARNING · BY GUSTAVO

Banking Fraud
System

Banking fraud is a serious issue because mistakes can cost people and financial institutions a lot of money. I chose this project to explore how machine learning can help detect suspicious transactions while avoiding unnecessary alerts on legitimate payments.

ULB / Worldline credit card data · Historical benchmark · Selected model: Logistic Regression

Explore the results
Frauds detected49/74

Detected in the test set
25 frauds remain missed

Alerts that were fraud92.45%

Alert precision
49 frauds out of 53 alerts

False alarms4

Legitimate payments flagged
In the final test period

Evaluation scope56.7K

Later test transactions
56,746 held-out records

53 Review Alerts, with Both Error Types Visible

Fraud accounts for only 74 of 56,746 test transactions. A model that clears every payment would look highly accurate but catch no fraud. I therefore selected by Average Precision and reported the actual review workload, detected frauds and missed frauds at one fixed alert threshold.

Train on the Past, Select on Validation, Test on the Future

01

Training · 170,235 transactions

Fit on 342 frauds and the earlier legitimate payments. Remove exact duplicate rows before splitting; keep timestamp cohorts together and fit preprocessing only on training data.

02

Validation · 56,745 transactions

Use 57 frauds to compare four classifiers by Average Precision. Select Logistic Regression, then choose its alert threshold by validation F1.

03

Test · 56,746 transactions

Evaluate the locked model and threshold on 74 later frauds. Preserve the natural class imbalance. Final test labels do not choose the model or threshold.

Evaluation protocol · Exact counts and threshold

Detection Performance and Model Selection

Inspect the outcomes.
See how the model was selected.

01 / FRAUD DETECTIONFinal test · 74 frauds

The Model Detects 66.2% of Test Fraud Cases

On the chronological test set, the selected model detects 49 of 74 fraudulent transactions, corresponding to 66.2% recall.

25 fraudulent transactions remain undetected. The result demonstrates the coverage limitation at the selected alert threshold, despite only four false alerts.

49 detected · 25 missed

Detected and missed fraud

The percentage uses actual fraud cases as its denominator. Select a caption to inspect an outcome. View source
02 / CLASSIFICATION OUTCOMESActual transaction counts

Alert Precision Reaches 92.45% on the Test Set

The confusion matrix separates correctly identified fraud, missed fraud, false alerts and correctly unflagged legitimate payments across 56,746 test transactions.

53 alerts across 56,746 transactions equals 9.34 reviews per 10,000 payments. Of those alerts, 49 match recorded fraud labels and four are legitimate, yielding 92.45% precision.

Select a cell to inspect its meaning.

Transaction outcome matrix

These are predictions evaluated against recorded labels in an offline benchmark. View source
03 / MODEL SELECTIONValidation · higher is better

Logistic Regression Leads on Validation Average Precision

Logistic Regression records validation AP 0.7723, ahead of LightGBM (0.7636), Random Forest (0.7588) and XGBoost (0.7573). Its final-test AP is 0.7439. The selection rule was highest validation AP, not highest F1 or model complexity.

Average Precision measures how well the model ranks rare fraud cases. It is a score from 0 to 1, rather than a percentage of correct payments.

Model selection uses validation data; the final test remains separate.

Validation model comparison

Validation contains 57 frauds. Small score differences do not establish statistical superiority. View source
04 / MODEL EXPLANATIONSSHAP · validation observations

SHAP Explains the Main Contributors to Model Scores

V4, Amount and V14 have the largest average absolute SHAP values in the 1,000-observation validation explanation sample. The chart shows which inputs move the model’s risk score most, not a ranked list of real-world causes of fraud.

Amount is the transaction amount. The V features are anonymized components whose original business meanings are unavailable.

Select an input to see what its label means.

Model input influence

Explanations use 1,000 validation observations. Impact size does not show direction, causation or a fraud probability. View source

A Useful Review Trade-off, with Remaining Evaluation Work

01

Ranking quality

Final-test AP 0.7439 and ROC-AUC 0.9818 describe ranking. At the selected operating point, recall is 66.22% and precision is 92.45%. Those are different questions.

02

Repeated-feature sensitivity

Exclude test feature vectors seen earlier: 55,026 transactions remain. AP is 0.7440 and ROC-AUC is 0.9815 using the same model and threshold.

03

Next validation

Use a longer, more recent cohort and a defined review budget or fraud-cost policy. Class-weighted scores need probability calibration; the dataset lacks cardholder IDs and label-arrival timestamps.

Test and sensitivity results

Reproducible Fraud Evaluation
with Transparent Error Analysis

I built the shared Python benchmark, temporal splits, selection policy and report generation, then exposed saved results in Streamlit without retraining. CI checks metric reproducibility, temporal boundaries, threshold selection, report integrity and dashboard behavior. The historical test demonstrates an evaluation workflow; it does not establish automatic blocking performance or financial savings.

Explore on GitHub

Reviewed 22 October 2026 against the project README and linked evaluation reports. Figures describe the documented dataset or test run.

BEHIND THE EXECUTIVE SUMMARY

Technical details