namebrandon / Sparkov_Data_Generation

Synthetic Credit Card Transaction Generator used in the Sparkov program.
MIT License
141 stars 64 forks source link

Generate Fake Credit Card Transaction Data, Including Fraudulent Transactions

Note: Version v1.0 behavior has changed in such a way that it runs much faster, however transaction files are chunked, so that several files get generated per profile. If your downstream process expects 1 file per profile, please checkout the v0.5 release branch release/v0.5.

General Usage

In this version, the general usage has changed:

Please run the datagen script as follow:

python datagen.py -n <NUMBER_OF_CUSTOMERS_TO_GENERATE> -o <OUTPUT_FOLDER> <START_DATE> <END_DATE>

To see the full list of options, use:

python datagen.py -h

You can pass additional options with the following flags:

This version is modified from the version v0.5 to parallelize the work using multiprocessing, so as to take advantage of all available CPUs and bring a huge speed improvement.

Because of the way it parallelize the work (chunking transaction generation by chunking the customer list), there will be multiple transaction files generated per profile. Also not that if the number of customers is small, there may be empty files (i.e. files where no customer in the chunk matched the profile). This is expected.

With standard profiles, it was benchmarked as generating ~95MB/thread/min. With a 64 cores/128 threads AMD E3, I was able to generate 1.4TB of data, 4.5B transactions, in just under 2h, as opposed to days when running the previous versions.

The generation code is originally based on code by Josh Plotkin. Change log of modifications to original code are below.

Change Log

v1.0

v0.5

v0.4

v0.3

v0.2

v0.1