Skip to main content

Package for Synthetic Data Generation using Distributional Learninig of VAE

Project description

DistVAE-Tabular

DistVAE is a novel approach to distributional learning in the VAE framework, focusing on accurately capturing the underlying distribution of the observed dataset through a nonparametric CDF estimation.

We utilize the continuous ranked probability score (CRPS), a strictly proper scoring rule, as the reconstruction loss while preserving the mathematical derivation of the lower bound of the data log-likelihood. Additionally, we introduce a synthetic data generation mechanism that effectively preserves differential privacy.

For a detailed method explanations, check our paper! (link)

1. Installation

Install using pip:

pip install distvae-tabular

2. Usage

from distvae_tabular import distvae
distvae.DistVAE # DistVAE model
distvae.generate_data # generate synthetic data

Example

"""device setting"""
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

"""load dataset and specify column types"""
import pandas as pd
data = pd.read_csv('./loan.csv') 
continuous_features = [
    'Age',
    'Experience',
    'Income', 
    'CCAvg',
    'Mortgage',
]
categorical_features = [
    'Family',
    'Personal Loan',
    'Securities Account',
    'CD Account',
    'Online',
    'CreditCard'
]
integer_features = [
    'Age',
    'Experience',
    'Income', 
    'Mortgage'
]

"""DistVAE"""
from distvae_tabular import distvae

distvae = distvae.DistVAE(
    data=data,
    continuous_features=continuous_features,
    categorical_features=categorical_features,
    integer_features=integer_features,
    epochs=5 # for quick checking (default is 1000)
)

"""training"""
distvae.train()

"""generate synthetic data"""
syndata = distvae.generate_data(100)
syndata

"""generate synthetic data with Differential Privacy"""
syndata = distvae.generate_data(100, lambda_=0.1)
syndata

Citation

If you use this code or package, please cite our associated paper:

@article{an2024distributional,
  title={Distributional learning of variational AutoEncoder: application to synthetic data generation},
  author={An, Seunghwan and Jeon, Jong-June},
  journal={Advances in Neural Information Processing Systems},
  volume={36},
  year={2024}
}

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

distvae_tabular-0.1.3.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

distvae_tabular-0.1.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file distvae_tabular-0.1.3.tar.gz.

File metadata

  • Download URL: distvae_tabular-0.1.3.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for distvae_tabular-0.1.3.tar.gz
Algorithm Hash digest
SHA256 36b847abb08d09bebd045e4c39bb86d48e2678b59166c9944134e2a32a71477f
MD5 0532975dac0ffb5cce84e4d6232ec204
BLAKE2b-256 44716d01b8d18fa2213ffbabae11adbb7ec430432a65bdaeceab30596ff620a3

See more details on using hashes here.

File details

Details for the file distvae_tabular-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for distvae_tabular-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 823da9514a9b36c4ec45579e178d3fb4ef5d95946033fbaf65e4cde1caf78352
MD5 607620269ff9f7a1e915f340c55d8851
BLAKE2b-256 b40c8b2472ed7d8cb6004d425390853ae6aa3b2cdb4306b7f833957efb3b52f6

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