Skip to content

RAISE Synthetic Data Generator

Description

RAISE Synthetic Data Generator is a local pip package that creates shareable tabular samples you can later upload on a dataset as the sample file. It is not a button in the portal upload wizard.

The package can also be used outside RAISE as a lightweight synthetic data generator.

Requires Python 3.9+. Current version on PyPI: 0.1.11. Package page: https://pypi.org/project/raise-synthetic-data-generator/

Features

The module provides a single main function: generate_synthetic_data.

  • Input flexibility — a CSV path or a pandas.DataFrame.
  • Automatic or manual model selection — "auto-select" (default), or CTGAN, TVAE, or Copulas.
  • Synthetic data generation — same properties as the input; size set with n_samples (defaults to the input size).
  • Results storage — synthetic_data.csv and info.txt in a run-specific folder under output_dir.
  • Evaluation report (optional) — evaluation_report=True (default) writes evaluation_report.pdf and figures.
  • Logging — each step is logged; exceptions are re-raised.

Installation

Terminal window
pip install raise-synthetic-data-generator

Verify:

import raise_synthetic_data_generator

Troubleshooting

  • Use a virtual environment.
  • On some systems: pip3 install raise-synthetic-data-generator.

Usage

from raise_synthetic_data_generator import generate_synthetic_data
import pandas as pd
df = pd.DataFrame(
{"age": [23, 35, 44, 29, 31], "country": ["ES", "FR", "DE", "IT", "ES"]}
)
generate_synthetic_data(
dataset=df, # or a CSV filename
selected_model="auto-select", # or "CTGAN", "TVAE", "Copulas"
n_samples=10,
evaluation_report=True,
output_dir="results",
run_name="demo-run",
)

This writes, under the run folder:

  • synthetic_data.csv
  • info.txt
  • evaluation_figures (if evaluation is on)
  • evaluation_report.pdf (if evaluation is on)

Upload synthetic_data.csv as the dataset sample (type Shortened or Anonymised as appropriate) after you create the dataset. See Make your data accessible.

API Reference

generate_synthetic_data(dataset, selected_model, n_samples, evaluation_report, output_dir, run_name)

  • dataset (str or pandas.DataFrame) — CSV path or DataFrame.
  • selected_model (str, optional) — "auto-select", "CTGAN", "TVAE", or "Copulas". Default "auto-select".
  • n_samples (int, optional) — number of synthetic rows. Default is the size of dataset.
  • evaluation_report (bool, optional) — write the PDF report. Default True.
  • output_dir (str or Path, optional) — base output directory. Default "results".
  • run_name (str, optional) — subfolder name. Default is generated.