Code Monkey home page Code Monkey logo

ccfraudml's Introduction

CCFraudML (Credit Card Fraud Detection Model)

Introduction

Credit card fraud detection using Scikit-Learn and Snap ML. This README provides an overview of a machine learning model designed to detect credit card fraud using Python and Snap ML. The model utilizes supervised learning techniques and is implemented using the snapml library for efficient training and inference.

Setup

Before running the code, ensure you have the required libraries installed. You can install them using pip: !pip install snapml

Dataset

The dataset used for training and evaluation is available at the following URL: Credit Card Fraud Dataset

Code Overview

  1. Import Libraries: Install necessary packages and import required libraries.
  2. Data Preprocessing: Read the dataset, inflate it to replicate actual size, and perform data normalization.
  3. Train/Test Split: Split the dataset into training and testing sets.
  4. Build Decision Tree Classifier (DTC): Train a DTC model using both Scikit-Learn and Snap ML, compare training times and ROC-AUC scores.
  5. Build Support Vector Machine (SVM): Train a SVM model using both Scikit-Learn and Snap ML, compare training times and ROC-AUC scores.
  6. Model Evaluation: Evaluate the quality of SVM models using the hinge loss metric.

Results

  • Decision Tree Classifier (DTC):

    • Snap ML vs. Scikit-Learn speedup: 7.62x
    • Scikit-Learn ROC-AUC score: 0.966
    • Snap ML ROC-AUC score: 0.966
  • Support Vector Machine (SVM):

    • Snap ML vs. Scikit-Learn speedup: 4.68x
    • Scikit-Learn ROC-AUC score: 0.984
    • Snap ML ROC-AUC score: 0.985
    • Hinge Loss (Snap ML): 0.228
    • Hinge Loss (Scikit-Learn): 0.234

Conclusion

The Snap ML library demonstrates significant speedup in training time compared to Scikit-Learn while maintaining comparable model performance metrics, making it a valuable tool for large-scale machine learning tasks.Snap ML leverages advanced parallel processing capabilities, making use of multi-core CPUs and other optimizations to significantly accelerate the training process.

ccfraudml's People

Contributors

lauras5 avatar

Watchers

 avatar

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.