A machine learning system that identifies fraudulent credit card transactions from a highly imbalanced dataset of 284,807 transactions using advanced classification algorithms and comprehensive evaluation metrics.
An end-to-end machine learning pipeline for detecting fraudulent credit card transactions, handling extreme class imbalance with a fraud ratio of just 0.172%.
Credit card transactions made by European cardholders in September 2013, containing PCA-transformed anonymized features.
| Source | Kaggle — MLG ULB |
| Total Transactions | 284,807 |
| Fraud Cases | 492 (0.172%) |
| Legitimate Cases | 284,315 (99.828%) |
| Features | 31 columns |
| Imbalance Ratio | ~578:1 |
| Feature | Description |
|---|---|
| Time | Seconds since first transaction |
| V1–V28 | PCA-transformed (anonymized) |
| Amount | Transaction amount ($) |
| Class | 0 = Legit, 1 = Fraud |
A systematic machine learning workflow from data ingestion to model deployment.
Four classification algorithms trained with balanced class weights to handle the extreme imbalance in fraud detection.
Comprehensive model comparison across multiple metrics with emphasis on Recall, F1-Score, and ROC-AUC for fraud detection effectiveness.
| Model | Accuracy | Precision | Recall | F1 Score | ROC-AUC |
|---|---|---|---|---|---|
| Logistic Regression | 0.9745 | 0.0609 | 0.9184 | 0.1143 | 0.9769 |
| Decision Tree | 0.9991 | 0.7317 | 0.7551 | 0.7432 | 0.8774 |
| Random Forest | 0.9996 | 0.9487 | 0.7551 | 0.8409 | 0.9519 |
| 🏆 Gradient Boosting | 0.9995 | 0.8750 | 0.7857 | 0.8279 | 0.9723 |
* Results are approximate. Run python main.py to generate actual metrics.
Clean, modular architecture following software engineering best practices.
Modular design with separation of concerns for maintainability and reusability.
All visualizations are generated automatically by the pipeline and saved in the
outputs/ directory.
Get the project running in just a few simple steps.