Skip to content

MrMuscleFreak/Fraud-Detection-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fraud Detection Project

Machine learning project for credit card fraud detection. We explored why accuracy is a terrible metric for imbalanced datasets and tested different approaches to actually catch frauds.

What's This About?

The credit card dataset has 284,807 transactions but only 0.17% are frauds. This creates a nasty problem: a dumb model that just says "not fraud" for everything still gets 99.83% accuracy. Sounds great until you realize it catches zero frauds.

We dug into this problem and tested several solutions.

Main Results

Model Accuracy Recall What It Means
"Always Not Fraud" 99.83% 0% Useless
Random Forest (regular) ~99.9% ~76% Decent
Random Forest + SMOTE ~99.9% ~92% Best

TL;DR: Forget accuracy. Look at recall, precision, F1, and AUPRC for fraud detection.

Quick Start

git clone https://github.com/MrMuscleFreak/Fraud-Detection-Project.git
cd Fraud-Detection-Project
python -m venv venv
venv\Scripts\activate  # Windows
python setup_project.py
jupyter notebook

Download the dataset from Kaggle and drop it in the data/ folder.

Notebooks

  1. 01 - Data overview and why accuracy is misleading
  2. 02 - Baseline models (majority class, random guess, amount threshold)
  3. 03 - Balancing strategies (undersampling, oversampling, SMOTE)
  4. 04 - Random Forest with full evaluation dashboard

Check out project_report.md for the full writeup.

About

Business goal: Detect rare fraud; demonstrate why baseline dominates accuracy. Demonstrate why accuracy fails in extreme imbalance. Compare baselines, balancing strategies, and precision–recall tradeoffs.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors