Skip to content

This project implements machine learning models to detect fraudulent credit card transactions. It includes data preprocessing, feature encoding, class balancing, and evaluation of various models like Logistic Regression, Decision Trees, Random Forest, SVM, Naive Bayes, and XGBoost. The final results are compared through accuracy visualizations.

Notifications You must be signed in to change notification settings

tonmoy7722/Credit-Card-Fraud-Detection-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Credit Card Fraud Detection

This project aims to build a predictive model to detect fraudulent credit card transactions using machine learning techniques. The dataset used in this project contains transaction details, and the target is to classify transactions as either fraud or non-fraud.

Project Workflow

  1. Data Loading and Preprocessing

    • Load the dataset and clean the data.
    • Convert date and time fields to appropriate formats.
    • Encode categorical variables using Label Encoding and WOE Encoding.
  2. Data Balancing

    • Address class imbalance through downsampling of the majority class.
  3. Feature Scaling

    • Standardize the features using StandardScaler.
  4. Model Training

    • Train multiple machine learning models:
      • Logistic Regression
      • Decision Tree
      • Random Forest
      • Gaussian Naive Bayes
      • Support Vector Machine (SVC)
      • XGBoost Classifier
  5. Evaluation

    • Compare the models using accuracy and visualize the results in bar charts.

Visualizations

  • Gender distribution of fraud and non-fraud cases.
  • Fraud distribution across transaction hours.
  • Original vs. downsampled class distributions.
  • Model accuracy comparison.

Libraries Used

  • pandas
  • numpy
  • seaborn
  • matplotlib
  • category_encoders
  • scikit-learn
  • xgboost

How to Run

  1. Install required dependencies:
    pip install category_encoders scikit-learn xgboost
  2. Load the dataset and follow the workflow outlined in the code.

Author

Developed by Tonmoy Day Sarkar as part of a machine learning project on fraud detection.

About

This project implements machine learning models to detect fraudulent credit card transactions. It includes data preprocessing, feature encoding, class balancing, and evaluation of various models like Logistic Regression, Decision Trees, Random Forest, SVM, Naive Bayes, and XGBoost. The final results are compared through accuracy visualizations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published