Skip to content

πŸš€ Credit Card Fraud Detection using Machine Learning Built an intelligent fraud detection system that classifies transactions as fraudulent or legitimate using real-world credit card data. Features real-time simulation, model evaluation, and a fully functional Streamlit-based web app.

Notifications You must be signed in to change notification settings

Sohamgujar/Credit-Card-Fraud-Detection-using-Machine-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’³ Credit Card Fraud Detection using Machine Learning

Detecting fraudulent credit card transactions using Logistic Regression, SMOTE balancing, and performance evaluation techniques. Includes an interactive web app built using Streamlit.


πŸš€ Project Overview

This project aims to identify fraudulent transactions in credit card data. Due to the rarity of fraud cases, the dataset is highly imbalanced β€” a challenge tackled with SMOTE (Synthetic Minority Oversampling Technique). The model is deployed as a web app using Streamlit for easy interaction and real-time testing.


πŸ“‚ Folder Structure

CreditCardFraudDetection/ β”‚ β”œβ”€β”€ data/ β”‚ └── creditcard.csv # Dataset from Kaggle β”œβ”€β”€ fraud_detection.py # CLI model training and evaluation β”œβ”€β”€ fraud_webapp.py # Streamlit interactive web app β”œβ”€β”€ requirements.txt # All dependencies └── README.md # Project documentation (this file)


🧠 Key Features

  • βœ… Data preprocessing and cleaning
  • βš–οΈ Imbalanced data handling using SMOTE
  • πŸ“ˆ Model training using Logistic Regression
  • πŸ“Š Performance metrics: Confusion Matrix, F1-Score, ROC-AUC
  • πŸ§ͺ Real-time transaction fraud simulation
  • 🌐 Interactive web app with user controls (Streamlit)

πŸ“Š Dataset

Class labels:

  • 0 = Legit
  • 1 = Fraud

πŸ“ˆ Model Performance (Logistic Regression)

Metric Value
Precision 0.76
Recall 0.86
F1-Score 0.81
ROC-AUC Score 0.9833 βœ…

πŸ–₯️ How to Run Locally

πŸ“Œ Clone the Repo

git clone https://github.com/yourusername/CreditCardFraudDetection.git
cd CreditCardFraudDetection

for requirment 
pip install -r requirements.txt

for streamlit 
streamlit run fraud_webapp.py

for venv
python -m venv venv
venv\Scripts\activate

About

πŸš€ Credit Card Fraud Detection using Machine Learning Built an intelligent fraud detection system that classifies transactions as fraudulent or legitimate using real-world credit card data. Features real-time simulation, model evaluation, and a fully functional Streamlit-based web app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages