# CTGAN

> Python library of deep learning synthetic data generators (CTGAN and TVAE) for single-table tabular data.

CTGAN is a Python library from DataCebo, part of the Synthetic Data Vault Project, that learns from real single-table data and generates synthetic data. It implements the CTGAN and TVAE models described in the 2019 NeurIPS paper "Modeling Tabular data using Conditional GAN". It can be used standalone or through the SDV library.

## What It Is

CTGAN is a collection of deep learning based synthetic data generators for tabular data. Users fit a model on a real table, specifying which columns are discrete, and then sample as many synthetic rows as they need. The README describes the generators as able to learn from real data and produce synthetic data with high fidelity.

## Workflow and Data Preparation

A typical workflow loads a dataframe, lists the discrete columns, creates a CTGAN model with a chosen number of epochs, calls fit, and then calls sample to produce synthetic rows. A built-in demo dataset, the Adult Census dataset, is included for trying it out. When used standalone, data may need manual preprocessing: continuous data must be floats, discrete data must be ints or strings, and the data must not contain missing values. The SDV library provides wrappers for preprocessing and extras such as constraints.

## Installation and Licensing

The library installs with pip or conda. It is published under the Business Source License 1.1, which is not an open source license. The additional use grant permits use except for offering a Synthetic Data Creation Service to third parties, and the license converts to MIT four years after each release's date. The README lists the development status as Pre-Alpha, and the latest listed release is v0.12.1.

## Features
- CTGAN conditional GAN model for single-table tabular data
- TVAE model implementation
- Fit on real data and sample synthetic rows
- Built-in demo dataset (Adult Census)
- Standalone use or access through the SDV library
- Install via pip or conda

## Integrations
SDV, PyTorch

## Platforms
API, DEVELOPER_SDK, CLI

## Pricing
Free

## Version
v0.12.1

## Links
- Website: https://github.com/sdv-dev/CTGAN
- Documentation: https://bit.ly/sdv-docs
- Repository: https://github.com/sdv-dev/CTGAN
- EveryDev.ai: https://www.everydev.ai/tools/ctgan
