Giter VIP home page Giter VIP logo

fraudnlp's Introduction

Fraud Detection with NLP

Data loading and preprocessing code for the paper titled 'Fraud Detection with NLP', which demonstrates the use of natural language processing techniques to detect fraud in financial transactions.

Dependencies

This code requires the following Python packages:

  • pandas
  • numpy
  • sklearn
  • ast
  • tensorflow

These can be installed using pip or another package manager.

Usage

To use this code, you will need to have the following files in your working directory:

  • Fraud Detection with Natural Language Processing.pkl: a pickled Pandas DataFrame containing the credit card transaction data
  • vocab.csv: a CSV file containing a list of action names and their corresponding IDs

Once these files are in place, you can run the code and generate several new columns in the DataFrame, including:

  • Action time mean: the average time between actions in a transaction
  • Action time std: the standard deviation of the time between actions
  • log(amount): the natural logarithm of the transaction amount
  • Transaction Type: a string indicating whether the transaction is fraudulent or not
  • time_to_first_action: the time between the start of the transaction and the first action taken
  • actions_str: a string containing the names of all actions taken in the transaction
  • total_time_to_transaction: the total time elapsed from the start of the transaction to its completion

Notes

  • The code assumes that the actions column in the DataFrame is a list of lists, where each inner list contains a sequence of actions taken in a single transaction.
  • The code also assumes that the times column in the DataFrame is a list of lists, where each inner list contains the timestamp (in milliseconds) of each action taken in a single transaction.

fraudnlp's People

Contributors

pboulieris 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.