Detecting fraudulent credit card transactions using Logistic Regression, SMOTE balancing, and performance evaluation techniques. Includes an interactive web app built using Streamlit.
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.
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)
- β 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)
- Source: Kaggle - Credit Card Fraud Detection
- Size: 284,807 transactions
- Features: V1βV28 (PCA anonymized),
Time,Amount, andClass
Class labels:
0= Legit1= Fraud
| Metric | Value |
|---|---|
| Precision | 0.76 |
| Recall | 0.86 |
| F1-Score | 0.81 |
| ROC-AUC Score | 0.9833 β |
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