Code Monkey home page Code Monkey logo

feature-engineering-for-credit-card-fraud-detection's Introduction

Feature Engineering for Credit Card Fraud Detection

Background

A credit card fraud detection algorithm consists in identifying those transactions with a high probability of being fraud, based on historical fraud patterns. The use of machine learning in fraud detection has been an interesting topic in recent years. Most of these studies compare their proposed algorithms with a benchmark algorithm and then make the comparison using a standard binary classification measure, such as misclassification error, receiver operating characteristic (ROC), Kolmogorov–Smirnov (KS), F1 Score (Bolton et al., 2002; Hand et al., 2007) or AUC statistics (Dal Pozzolo et al., 2014). Most of these measures are extracted by using a confusion matrix as shown below: image

where the prediction of the algorithm ci is a function of the k features of transaction i. However, the cost of false negative is 100 times higher than false positive. Besides, assuming constant cost for false negatives is unrealistic. In this case, example-dependent cost matrix is introduced.

In summary, a single transaction information is not sufficient to detect a fraudulent transaction, the important information we want to capture is the consumer spending behavior, which is usually used by commercial fraud detection systems. This project aims to construct 20 features to capture customers' spending behaviour by transaction aggregation strategy. The aggregation features consists in grouping the transactions made during the last given number of hours, first by card or account number, then by transaction type, merchant group, country or other, followed by calculating the number of transactions or the total amount spent on those transactions.

Note In practice, when time passes, information lose their value, in the sense that a customer spending patterns are not expected to remain constant over the years. Whitrow et al. definea fixed time frame to be 24, 60 or 168 h.

data source https://data.ok.gov/dataset/purchase-card-pcard-fiscal-year-2014*

Steps

  • EDA
  • feature engineering: Create 20 features
  • Data visualization by plotly
  • unsupervised learning (future)

image

feature-engineering-for-credit-card-fraud-detection's People

Contributors

hz2657 avatar

Watchers

James Cloos avatar  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.