Skip to main content

Benchmark tabular synthetic data generators using a variety of datasets

Project description


This repository is part of The Synthetic Data Vault Project, a project from DataCebo.

Development Status Travis PyPi Shield Downloads Slack

Overview

The Synthetic Data Gym (SDGym) is a benchmarking framework for modeling and generating synthetic data. Measure performance and memory usage across different synthetic data modeling techniques – classical statistics, deep learning and more!

The SDGym library integrates with the Synthetic Data Vault ecosystem. You can use any of its synthesizers, datasets or metrics for benchmarking. You can also customize the process to include your own work.

  • Datasets: Select any of the publicly available datasets from the SDV project, or input your own data.
  • Synthesizers: Choose from any of the SDV synthesizers and baselines. Or write your own custom machine learning model.
  • Evaluation: In addition to performance and memory usage, you can also measure synthetic data quality and privacy through a variety of metrics.

Install

Install SDGym using pip or conda. We recommend using a virtual environment to avoid conflicts with other software on your device.

pip install sdgym
conda install -c pytorch -c conda-forge sdgym

For more information about using SDGym, visit the SDGym Documentation.

Usage

Let's benchmark synthetic data generation for single tables. First, let's define which modeling techniques we want to use. Let's choose a few synthesizers from the SDV library and a few others to use as baselines.

# these synthesizers come from the SDV library
# each one uses different modeling techniques
sdv_synthesizers = ['GaussianCopulaSynthesizer', 'CTGANSynthesizer']

# these basic synthesizers are available in SDGym
# as baselines
baseline_synthesizers = ['UniformSynthesizer']

Now, we can benchmark the different techniques:

import sdgym

sdgym.benchmark_single_table(
    synthesizers=(sdv_synthesizers + baseline_synthesizers)
)

The result is a detailed performance, memory and quality evaluation across the synthesizers on a variety of publicly available datasets.

Supplying a custom synthesizer

Benchmark your own synthetic data generation techniques. Define your synthesizer by specifying the training logic (using machine learning) and the sampling logic.

def my_training_logic(data, metadata):
    # create an object to represent your synthesizer
    # train it using the data
    return synthesizer

def my_sampling_logic(trained_synthesizer, num_rows):
    # use the trained synthesizer to create
    # num_rows of synthetic data
    return synthetic_data

Learn more in the Custom Synthesizers Guide.

Customizing your datasets

The SDGym library includes many publicly available datasets that you can include right away. List these using the get_available_datasets feature.

sdgym.get_available_datasets()
dataset_name   size_MB     num_tables
KRK_v1         0.072128    1
adult          3.907448    1
alarm          4.520128    1
asia           1.280128    1
...

You can also include any custom, private datasets that are stored on your computer on an Amazon S3 bucket.

my_datasets_folder = 's3://my-datasets-bucket'

For more information, see the docs for Customized Datasets.

What's next?

Visit the SDGym Documentation to learn more!




The Synthetic Data Vault Project was first created at MIT's Data to AI Lab in 2016. After 4 years of research and traction with enterprise, we created DataCebo in 2020 with the goal of growing the project. Today, DataCebo is the proud developer of SDV, the largest ecosystem for synthetic data generation & evaluation. It is home to multiple libraries that support synthetic data, including:

  • 🔄 Data discovery & transformation. Reverse the transforms to reproduce realistic data.
  • 🧠 Multiple machine learning models -- ranging from Copulas to Deep Learning -- to create tabular, multi table and time series data.
  • 📊 Measuring quality and privacy of synthetic data, and comparing different synthetic data generation models.

Get started using the SDV package -- a fully integrated solution and your one-stop shop for synthetic data. Or, use the standalone libraries for specific needs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdgym-0.9.1.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

sdgym-0.9.1-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file sdgym-0.9.1.tar.gz.

File metadata

  • Download URL: sdgym-0.9.1.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.1 tqdm/4.66.4 importlib-metadata/7.1.0 keyring/25.2.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.14

File hashes

Hashes for sdgym-0.9.1.tar.gz
Algorithm Hash digest
SHA256 f4368c51f62d52f3d80eab6515cbc1a91c8d905d454d141aa15e7e225e4c03f0
MD5 17a5bd35f4378411f065b4e4c3f17006
BLAKE2b-256 ef3bf99ae14a735044650289f9c006cdb86175d379afbcb4be57e8cf01d3382a

See more details on using hashes here.

File details

Details for the file sdgym-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: sdgym-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.1 tqdm/4.66.4 importlib-metadata/7.1.0 keyring/25.2.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.14

File hashes

Hashes for sdgym-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 047fb1b88b7618219696bfddade02f3b88874781644d9e61cca0430f4cf79c90
MD5 fb59842e9c25a42bbad83fbe40409977
BLAKE2b-256 a58e45af88ac2848d9bb44a14126b722c305deb281e12647a08269b49939cb04

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page