ML · Imbalanced Classification

Credit Card Fraud Detection

A fraud-detection pipeline on a 284k-transaction dataset with a 0.17 per cent fraud rate, comparing three models with SMOTE and precision-recall evaluation.

Demo currently unavailable

View source Space details
Credit Card Fraud Detection, application interface
Interface / Credit Card Fraud Detection Demo currently unavailable
01 / The problem

The challenge.

The dataset has 284,807 transactions and a 0.17 per cent fraud rate. A naive model scores 99.8 per cent accuracy by predicting that nothing is ever fraud, so accuracy is a trap and the whole problem lives in how you handle the imbalance.

02 / The system

The approach.

SMOTE oversampling on the training split, a comparison of XGBoost, Random Forest and Logistic Regression, and evaluation using classification reports, confusion matrices, ROC curves and precision-recall curves.

03 / Under the surface

Engineering decisions.

  1. SMOTE applied to the training split after a stratified train/test split.

  2. Three models compared head to head: XGBoost, Random Forest and Logistic Regression.

  3. Classification reports, confusion matrices, ROC and precision-recall curves for evaluation on imbalanced data.

  4. Reproducible Python training and evaluation scripts.

04 / What came out of it

The outcome.

Reproducible model comparison using precision, recall, F1 and ROC-AUC, with Python training and evaluation scripts available on GitHub. The hosted demo is currently offline.