fraud-detection-engine

Ensemble (Random Forest + Gradient Boosting + Logistic Regression) with SMOTE imbalance handling. Embedded model trained on synthetic data modeled after the Kaggle creditcard.csv — runs fully offline.

Score a transaction

SMOTE-style oversampling demo

Credit-card fraud makes up less than 1% of real transaction streams. Run this project’s pure-NumPy SMOTE oversampler on a 200/40 legit/fraud sample and watch the minority class grow — plus see why that matters for fraud recall.

Embedded model metrics

Fraud recall93.94%
Fraud precision98.41%
Fraud F10.961
Fraud AUC0.999
Accuracy99.92%
Decision threshold0.68
Test set size6000 (1.1% fraud)

Metrics are computed on a held-out, naturally imbalanced (~1.1% fraud) test set from the synthetic generator, at the F1-tuned decision threshold. Fraud-class recall is the headline number here — missing a fraud charge costs more than a false alert.