Skip to content

ShivekGosain/Credit_Card_Fraud_Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Credit Card Fraud Detection

πŸ“Œ Project Overview

Credit card fraud is a significant issue in the financial industry, leading to massive financial losses every year. The goal of this project is to build a fraud detection model that can distinguish between fraudulent and non-fraudulent transactions using machine learning.

The dataset is highly imbalanced, with fraudulent transactions making up less than 0.2% of all transactions. To tackle this, techniques such as SMOTE (Synthetic Minority Oversampling Technique) and feature scaling have been applied. Multiple models were trained and evaluated to identify the most effective fraud detection method.


πŸ“‚ Data Source

The dataset used in this project is the well-known Kaggle Credit Card Fraud Detection dataset.

  • πŸ“Š Transactions: 284,807
  • πŸ’³ Fraudulent transactions: 492 (0.17%)
  • πŸ”‘ Features: 30 (28 anonymized PCA components, Time, and Amount)
  • 🎯 Target: Class (0 = Non-Fraud, 1 = Fraud)

Dataset link: Credit Card Fraud Detection - Kaggle


βš™οΈ How It Works

  1. Exploratory Data Analysis (EDA)

    • Checked class imbalance.
    • Distribution of transaction Amount and Time.
    • Correlation heatmap of features.
  2. Data Preprocessing

    • Feature scaling using StandardScaler.
    • Oversampling minority class using SMOTE.
  3. Model Training

    • Models applied:

      • Logistic Regression
      • Random Forest
      • XGBoost
  4. Evaluation Metrics

    • Precision
    • Recall
    • F1-Score
    • ROC-AUC Score
    • Confusion Matrix

πŸ“ˆ Model Performance

Model Precision Recall F1-Score ROC-AUC
LogisticRegression 0.13 0.89 0.23 0.97
RandomForest 0.83 0.82 0.83 0.96
XGBoost 0.80 0.85 0.83 0.98

βœ”οΈ XGBoost performed best overall with the highest ROC-AUC score.


πŸš€ Future Improvements

  • Use deep learning models such as Autoencoders for anomaly detection.
  • Implement a real-time fraud detection pipeline.
  • Apply hyperparameter tuning for model optimization.
  • Deploy the model as a Flask/Django web app or using Streamlit.

πŸ“¬ Contact

If you have any questions or suggestions, feel free to connect!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors