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), orCTGAN,TVAE, orCopulas. - Synthetic data generation — same properties as the input; size set with
n_samples(defaults to the input size). - Results storage —
synthetic_data.csvandinfo.txtin a run-specific folder underoutput_dir. - Evaluation report (optional) —
evaluation_report=True(default) writesevaluation_report.pdfand figures. - Logging — each step is logged; exceptions are re-raised.
Installation
pip install raise-synthetic-data-generatorVerify:
import raise_synthetic_data_generatorTroubleshooting
- Use a virtual environment.
- On some systems:
pip3 install raise-synthetic-data-generator.
Usage
from raise_synthetic_data_generator import generate_synthetic_dataimport 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.csvinfo.txtevaluation_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(strorpandas.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 ofdataset.evaluation_report(bool, optional) — write the PDF report. DefaultTrue.output_dir(strorPath, optional) — base output directory. Default"results".run_name(str, optional) — subfolder name. Default is generated.