Skip to main content

Synthetic data generation for tables.

Project description

Welcome to probaforms

PyPI version Tests Docs Downloads License: MIT

Probaforms is a python library of conditional Generative Adversarial Networks, Normalizing Flows, Variational Autoencoders and other generative models for tabular data. All models have a sklearn-like interface to enable rapid use in a variety of science and engineering applications.

Implemented conditional models

  • Variational Autoencoder (CVAE)
  • Wasserstein GAN (WGAN)
  • Real NVP

Installation

pip install probaforms

or

git clone https://github.com/HSE-LAMBDA/probaforms.git
cd probaforms
pip install -e .

or

poetry install

Basic usage

(See more examples in the documentation.)

The following code snippet generates a noisy synthetic data, fits a conditional generative model, sample new objects, and displays the results.

from sklearn.datasets import make_moons
import matplotlib.pyplot as plt
from probaforms.models import RealNVP

# generate sample X with conditions C
X, y = make_moons(n_samples=1000, noise=0.1)
C = y.reshape(-1, 1)

# fit nomalizing flow model
model = RealNVP(lr=0.01, n_epochs=100)
model.fit(X, C)

# sample new objects
X_gen = model.sample(C)

# display the results
plt.scatter(X_gen[y==0, 0], X_gen[y==0, 1])
plt.scatter(X_gen[y==1, 0], X_gen[y==1, 1])
plt.show()

Support

Thanks to all our contributors

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

probaforms-0.2.0.tar.gz (11.0 kB view hashes)

Uploaded Source

Built Distribution

probaforms-0.2.0-py3-none-any.whl (16.1 kB view hashes)

Uploaded Python 3

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