Giter VIP home page Giter VIP logo

credit-card-fraud-detection's Introduction

Credit-Card-Fraud-Detection

Machine learning models to automatically predict credit card frauds

Dataset

The dataset for this project was obtained from kaggle website.
[https://www.kaggle.com/mlg-ulb/creditcardfraud]

Requirements

  • Python 3.6
  • Pandas and Numpy
  • Keras 2.1.6
  • TensorFlow 1.8
  • Sklearn Library 0.19.1
  • Python's Matplotlib (2.2.2) for Visualization

Exploratory Data Analysis

   1. Checking the target class. (0 - No Fraud  1 - Fraud).

   2. Checking Time of Transaction vs Amount of Transaction for each class ((0 - No Fraud  1 - Fraud)

   3.  Amount per Transaction for each class (0 - No Fraud  1 - Fraud)

   4. Correlation Matrix between different features of the dataset

   3. Describing the dataset 

Data Preprocessing

  1. Feature Elimination
  2. Data Normalization
  3. Balancing the skewed dataset using
    3.1 Undersampling technique
    3.2 Oversampling using SMOTE technique

Machine Learning Models

Used Sklearn, TensorFlow and Keras libraries to built the following models in Spyder IDE.

  1. Autoencoder Artificial Neural Networks
  2. Random Forest
  3. Logistic Rregression

Performace Evaluation

  1. 5 fold cross Validation
  2. Confusion Matrix
  3. Precision - Recall Curves
  4. Cohen's Kappa Statistic
  5. AUC - ROC curves

Results

1. Autoencoders - Artificial Neural Network

   1.1 Model Loss for Autoencoders  -  Plot of Loss vs Epoch of training and testing data

Epoch = 88 , Batch_size = 32

   1.2 Error Distribution of Autoencoders for each class (0 - No Fraud  1 - Fraud).

              reconstruction error with no fraud         reconstruction error with fraud

  1.3 AUC - ROC  and Confusion Matrix for Autoencoders Neural Nets

  1.3  Precision- Recall Curves for Autoencoders Neural Nets

2. Random Forest

     2.1  AUC - ROC for Random Forest

   2.2  Precision- Recall Curves for Random Forest

   2.3 Confusion Matrix for Random Forest

3. Logistic Rregression

     3.1  AUC - ROC for Logistic Rregression

     3.2  Precision- Recall Curves for Logistic Rregression

       3.3  Confusion Matrix for Logistic Rregression

credit-card-fraud-detection's People

Contributors

prajaktaag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gitusertd igorwc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.