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 quantile 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 # function for generating synthetic dataset
- See example.ipynb for detailed example and its results with
loandataset.- Link for download
loandataset: https://www.kaggle.com/datasets/teertha/personal-loan-modeling
- Link for download
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, # the observed tabular dataset
continuous_features=continuous_features, # the list of continuous columns of data
categorical_features=categorical_features, # the list of categorical columns of data
integer_features=integer_features, # the list of integer-type columns of data
seed=42, # seed for repeatable results
latent_dim=4, # the latent dimension size
beta=0.1, # scale parameter of asymmetric Laplace distribution
hidden_dim=128, # the number of nodes in MLP
epochs=5, # the number of epochs (for quick checking)
batch_size=256, # the batch size
lr=0.001, # learning rate
step=0.1, # interval size between knots
threshold=1e-8, # threshold for clipping alpha_tild (numerical stability)
device="cpu"
)
"""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
3. 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}
}
Metadata
Release files for distvae-tabular 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| distvae_tabular-0.2.4.tar.gz | 9.1 kB | Without provenance | Details for distvae_tabular-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| distvae_tabular-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for distvae_tabular-0.2.4-py3-none-any.whl |
Total release size: 18.3 kB
Release files / distvae_tabular-0.2.4.tar.gz
| Download URL | distvae_tabular-0.2.4.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
837b5eedbe0f67e75321f322510f7eb17f6350a605e7e50b448ba3411613c01c
|
|
BLAKE2b-256 checksum How to use checksums |
77f985fbf440f7940a4ee23feab0c4580c70bc78e962786a78bfeb22970ff3be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / distvae_tabular-0.2.4-py3-none-any.whl
| Download URL | distvae_tabular-0.2.4-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41739e2146bc6bffaa4f98395abe073bededb7762acbf3eee147604f4eab4c86
|
|
BLAKE2b-256 checksum How to use checksums |
a505350edd6dd75e8167b1534aab60ba3a71d754e3e3ca671f94a0ec67bbf3c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Security for distvae-tabular 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.