Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.


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

Development Status PyPI Shield Unit Tests Downloads Coverage Status Forum

Overview

CTGAN is a collection of Deep Learning based synthetic data generators for single table data, which are able to learn from real data and generate synthetic data with high fidelity.

Important Links
💻 Website Check out the SDV Website for more information about our overall synthetic data ecosystem.
📙 Blog A deeper look at open source, synthetic data creation and evaluation.
📖 Documentation Quickstarts, User and Development Guides, and API Reference.
:octocat: Repository The link to the Github Repository of this library.
⌨️ Development Status This software is in its Pre-Alpha stage.
👥 DataCebo Forum Discuss CTGAN features, ask questions, and receive help.

Currently, this library implements the CTGAN and TVAE models described in the Modeling Tabular data using Conditional GAN paper, presented at the 2019 NeurIPS conference.

Install

Use CTGAN through the SDV library

⚠️ If you're just getting started with synthetic data, we recommend installing the SDV library which provides user-friendly APIs for accessing CTGAN. ⚠️

The SDV library provides wrappers for preprocessing your data as well as additional usability features like constraints. See the SDV documentation to get started.

Use the CTGAN standalone library

Alternatively, you can also install and use CTGAN directly, as a standalone library:

Using pip:

pip install ctgan

Using conda:

conda install -c pytorch -c conda-forge ctgan

When using the CTGAN library directly, you may need to manually preprocess your data into the correct format, for example:

  • Continuous data must be represented as floats
  • Discrete data must be represented as ints or strings
  • The data should not contain any missing values

Usage Example

In this example we load the Adult Census Dataset* which is a built-in demo dataset. We use CTGAN to learn from the real data and then generate some synthetic data.

from ctgan import CTGAN
from ctgan import load_demo

real_data = load_demo()

# Names of the columns that are discrete
discrete_columns = [
    'workclass',
    'education',
    'marital-status',
    'occupation',
    'relationship',
    'race',
    'sex',
    'native-country',
    'income',
]

ctgan = CTGAN(epochs=10)
ctgan.fit(real_data, discrete_columns)

# Create synthetic data
synthetic_data = ctgan.sample(1000)

*For more information about the dataset see: Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.

Join our community

Join our forum to discuss more about CTGAN, ask questions, and receive help.

Interested in contributing to CTGAN? Read our Contribution Guide to get started.

Citing CTGAN

If you use CTGAN, please cite the following work:

Lei Xu, Maria Skoularidou, Alfredo Cuesta-Infante, Kalyan Veeramachaneni. Modeling Tabular data using Conditional GAN. NeurIPS, 2019.

@inproceedings{ctgan,
  title={Modeling Tabular data using Conditional GAN},
  author={Xu, Lei and Skoularidou, Maria and Cuesta-Infante, Alfredo and Veeramachaneni, Kalyan},
  booktitle={Advances in Neural Information Processing Systems},
  year={2019}
}

Related Projects

Please note that these projects are external to the SDV Ecosystem. They are not affiliated with or maintained by DataCebo.




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.

Metadata

Release files for ctgan 0.12.2.dev0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ctgan 0.12.2.dev0
File Size Uploaded Provenance Actions
ctgan-0.12.2.dev0.tar.gz 27.1 kB With provenance Details for ctgan-0.12.2.dev0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ctgan 0.12.2.dev0
File Interpreter ABI Platform Actions
ctgan-0.12.2.dev0-py3-none-any.whl Python 3 none any Details for ctgan-0.12.2.dev0-py3-none-any.whl

Total release size: 52.6 kB

Release files / ctgan-0.12.2.dev0.tar.gz

Download URL ctgan-0.12.2.dev0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4e0acb0ab731b9671132d0a235df8c9b710ff86e1201c1383f68b648b20fcfa9
BLAKE2b-256 checksum
How to use checksums
41687bde47695c11aafe25e2ddacc51636dada1c8873e1867f4da9b4df13e009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / ctgan-0.12.2.dev0-py3-none-any.whl

Download URL ctgan-0.12.2.dev0-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6fd3e0f66b8b2349237652628bd79e8bbf527425784f43913ec53a65a3daa94
BLAKE2b-256 checksum
How to use checksums
1e8c0cdde59cf9024fe9f4e9d908eb32cfdb0aeaee12ad106d91006a49287a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for ctgan 0.12.2.dev0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ctgan-0.12.2.dev0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page