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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file probaforms-0.2.0.tar.gz.

File metadata

  • Download URL: probaforms-0.2.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for probaforms-0.2.0.tar.gz
Algorithm Hash digest
SHA256 335e6df440f2dfb39c6d4daa8419d6ec9a6276108d292f7d2cfa9d7894651de0
MD5 3b76bb34ae6cfab5f271fb1238b08ca5
BLAKE2b-256 03968ff5b784ce7cac023d1f3908d355d756427db844286243fa4cafbea88dba

See more details on using hashes here.

File details

Details for the file probaforms-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: probaforms-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for probaforms-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e54ee791f624d60ff9d06d683c3fa61daa5daec592fc44b0d1ef7ae33c0b66
MD5 53c943f542e00d13e67830c92158186e
BLAKE2b-256 f6e103d028a8e4da64e7cac0c7974d3a05f047bca55fa73ab0d34b00655ef5b5

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