Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💳 Credit Card Fraud Detection with Machine Learning

📌 Project Overview

Credit card fraud is a major challenge in the financial industry, causing significant financial losses every year. This project uses Machine Learning techniques to identify fraudulent credit card transactions and compares multiple classification algorithms to determine the best-performing model.


📂 Dataset

  • Dataset: Kaggle Credit Card Fraud Detection Dataset
  • Total Transactions: 284,807
  • Data Type: Highly imbalanced
  • Fraud Cases: Very rare

To reduce training time, this project uses a sample of 30,000 transactions.


🚀 Features

  • Data preprocessing and cleaning
  • Fraud detection using Machine Learning
  • Model comparison
  • Interactive Streamlit dashboard
  • Fraud prediction from transaction data
  • Performance visualization using charts

🤖 Machine Learning Models

  • Logistic Regression
  • Decision Tree
  • Random Forest
  • XGBoost

📊 Evaluation Metrics

The models are evaluated using:

  • Accuracy
  • Precision
  • Recall
  • F1 Score
  • Confusion Matrix
  • ROC Curve

🏆 Best Performing Model

XGBoost achieved the best performance because it:

  • Handles imbalanced datasets effectively
  • Reduces overfitting
  • Learns complex fraud patterns
  • Provides high prediction accuracy

📈 Dashboard Features

The Streamlit dashboard includes:

  • Fraud vs Non-Fraud visualization
  • Model comparison
  • Confusion Matrix
  • ROC Curve
  • Transaction prediction interface

🛠️ Technologies Used

  • Python
  • Pandas
  • NumPy
  • Scikit-learn
  • XGBoost
  • Streamlit
  • Plotly
  • Matplotlib

▶️ How to Run

1. Clone the repository

git clone https://github.com/laxmisahani-data/Credit-Card-Fraud-Detection.git

2. Navigate to the project folder

cd Credit-Card-Fraud-Detection

3. Install dependencies

pip install -r requirements.txt

4. Run the Streamlit application

streamlit run app.py

📁 Project Structure

Credit-Card-Fraud-Detection
│── dataset/
│── models/
│── app.py
│── train_model.py
│── requirements.txt
│── README.md

Immediately after that, paste this:

## 📷 Application Screenshots

### 📊 Dashboard

![Dashboard](dashboard.png)

### 📈 Evaluation Metrics

![Metrics](metrics.png)

### 🔍 Prediction Page

![Prediction](prediction.png)

---

## 🔮 Future Improvements

- Improve fraud detection accuracy
- Deploy the application online
- Add real-time prediction support
- Integrate deep learning models

---

## 👩‍💻 Author

**Laxmi Sahani**

Data Engineering Student

Aspiring Data Analyst | Machine Learning Enthusiast

GitHub: https://github.com/laxmisahani-data

About

Machine Learning project to detect fraudulent credit card transactions using Python, Scikit-learn, XGBoost, and Streamlit.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages