Skip to main content

Clover: Synthetic Health Data Generation and Validation Library

License Python 3.8+ Tests with Pytest Coverage CI: Pytest Code Style: Black CI: Black Docs: Sphinx

Introducing Clover, a comprehensive library for generating and critically assessing tabular synthetic data. Clover provides eight synthetic data generators and a unified evaluation framework to assess the quality of the generated data. Evaluation focuses on how much information from the original data is preserved, as well as the level of privacy protection achieved.

Acknowledging the inherent trade-off between data utility and privacy, Clover is designed to support the creation of synthetic datasets that strike an effective balance between real-world usefulness and the imperative of safeguarding patient privacy. For each generator included in the library, a differentially private version is also available.

Table of Contents

Documentation

Documentation is available at : https://crchum-citadel.github.io/clover/

Current Features

  • Synthetic data generators incorporating integrated differential privacy, supporting continuous and categorical variables (unique identifiers are not handled):
  • Utility and privacy reports to assess the fidelity of the synthetic data:
    • Summary table
    • Detailed report with figures
  • The following utility metrics are implemented:
    • Univariate metrics
      • Continuous & categorical consistency
      • Continuous & categorical statistics
      • Hellinger distance
      • Kullback-Leibler divergence
    • Bivariate metrics
      • Pairwise Pearson and Spearman correlation difference
      • Pairwise Chi-square correlation difference
    • Population metrics
      • Distinguishability
      • Cross learning (regression & classification)
    • Application metrics
      • Prediction (regression & classification)
      • F-Score for binary classification with continuous variables only
      • Feature importance
  • The following privacy metrics are implemented:
    • Reidentification metrics: Assess the risk of linking records in the synthetic data back to specific individuals in the original real dataset.
      • Distance to Closest Record: Measures how similar each synthetic record is to its nearest neighbor in the real data, indicating potential for identifying near-duplicates.
      • Nearest Neighbor Distance Ratio: Compares the distance to the nearest neighbor within the synthetic data to the distance to the nearest neighbor in the real data for synthetic points, highlighting if synthetic points are too close to real ones.
    • Membership inference attack (MIA): Evaluates how well an adversary can determine if a particular record was part of the original training dataset used to generate the synthetic data.
      • GAN-Leaks: Specifically assesses the leakage of information from the training data in synthetic data generated by Generative Adversarial Networks (GANs).
      • Monte Carlo membership inference attack: A specific type of membership inference attack that uses Monte Carlo simulation to estimate the probability of a record being in the training data.
      • Logan: Assesses the risk of membership inference by training a model to distinguish between the first and second generations of synthetic data.
      • TableGan: Evaluates the vulnerability to membership inference by training both a discriminator (to distinguish between real and synthetic data) and a classifier (likely to predict whether a record was part of the training set).
      • Detector: Measures the susceptibility to membership inference by training a model to classify between the first generation of synthetic data and real data that was not used to generate the synthetic data.
      • Collision: Measures the frequency of identical or very similar records appearing in the synthetic dataset, which could indicate a privacy risk if unique real records are being replicated.
  • Metareport to compare several synthetic datasets with respect to the metrics

Usage

Requirements

All the required packages are available in the requirements file. Clover has been tested on a Linux system running Python 3.8.10 and Python 3.10.

Installation

The package is available on pypi. You can install the package on a conda environment with:

pip install -i https://test.pypi.org/simple/clover-synth

Quickstart

To get started, we created 4 notebooks to guide you through the generation of synthetic data, their associated utility and privacy reports and the hyperparameters tuning:

To get the average summary metrics results for both utility and privacy at once, see the combined report notebook. To compare several synthetic datasets with respect to a list of metrics, see the metareport notebook.

The notebooks are based on the Breast Wisconsin Cancer WBCD dataset.

Join Our Community

If you have any question, feature request or if you have encountered an issue, please open an issue on Github.

We also welcome any contribution to the project. The required packages for development can be found in the dev-requirements file. The documentation was generated with Sphinx.

Metadata

Release files for clover-synth 0.1.0

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

Source distribution (sdist)

Source distribution for clover-synth 0.1.0
File Size Uploaded Provenance Actions
clover_synth-0.1.0.tar.gz 2.0 MB With provenance Details for clover_synth-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clover-synth 0.1.0
File Interpreter ABI Platform Actions
clover_synth-0.1.0-py3-none-any.whl Python 3 none any Details for clover_synth-0.1.0-py3-none-any.whl

Total release size: 2.3 MB

Release files / clover_synth-0.1.0.tar.gz

Download URL clover_synth-0.1.0.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
4f4f4f0d7271eeffc09ccbc733a51c757b4db6bb68b435327a0f3b67e00ea2af
BLAKE2b-256 checksum
How to use checksums
9d57b9fc9f3a03a2899f96a3a71d64b382e6c9b91f26d87d9bacab6ca20e4d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Jan 23, 2026.

Transparency log

Release files / clover_synth-0.1.0-py3-none-any.whl

Download URL clover_synth-0.1.0-py3-none-any.whl
Size 231.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b07af87ba08da68b86dbbfe7bfd90e7245598759e1b1ab035a8d282987b18fd6
BLAKE2b-256 checksum
How to use checksums
de3ecbf17b964f14904c83b109a329b9e9e309f8984b11b3f81d5f983265da69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Jan 23, 2026.

Transparency log

Security for clover-synth 0.1.0

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 clover_synth-0.1.0.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 Jan 23, 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

0.1.0 This release

2 release files Full provenance

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