Skip to main content

CI PyPI DOI

TabDGP

A data-generating process (DGP) for grouped and flat tables.

TabDGP simulates tabular datasets from a random structural causal model (SCM) and aims to reproduce the quirks of real data. Each table comes with the graph and the settings that generated it.

Alpha. Release 0.3 draws grouped and flat tables with an outcome y, from defaults that are round guesses; the rest is planned below. Before 1.0, a release may change the dataset a key draws.

Highlights

  • Grouped or flat. One to three grouping factors by default, nested or crossed, with 2 to 400 groups each. A covariate varies by row or is constant within the groups of one factor. Hyperprior.flat() draws none.
  • An outcome. One node y, drawn by default as the last node of the SCM: continuous, binary, categorical, ordered or count, with its own noise scale. outcome_form='none' draws none.
  • White-box. Each dataset carries its graph, latent nodes, column metadata and hyperparameters.
  • Reproducible. A dataset is a pure function of its key (a seed and an index) and the hyperprior, whatever batch or worker draws it.
  • Overridable. Replace any default distribution by a point value or another distribution.

Install

pip install tabdgp

Quickstart

from tabdgp import Hyperprior, draw

hyperprior = Hyperprior.grouped(rows=100, design_columns=5)  # two overrides on the grouped preset
dataset = draw(seed=0, index=0, hyperprior=hyperprior)  # the key: a seed and an index
unit = dict(zip(dataset.graph.names, dataset.graph.unit))  # per row, or per group of a factor
for name, column in dataset.metadata.items():
    print(name, column.type, unit[name], dataset.columns[name][:3].round(2))
print(len(dataset.latent), 'latent nodes,', dataset.graph.parents.sum(), 'edges')
g0 categorical g0 [4 5 2]
g1 categorical g1 [ 6 22 29]
g2 categorical g2 [7 7 5]
x0 binary row [1 0 1]
x1 binary row [0 1 0]
x2 continuous g2 [1.77 1.77 2.66]
x3 binary row [0 0 1]
x4 binary g2 [0 0 1]
y continuous row [0.76 0.62 0.93]
7 latent nodes, 18 edges

Planned

  • Model-based outcomes: exact or with a drawn deviation for white-box misspecified datasets.
  • Quirk axes: group confounding, rare levels, ties, bounds, near dependence and more.
  • Finetuning the hyperprior's parameters to any batch of datasets. Group presets are tuned against mixedbench.
  • Within-group time and a binary treatment.

Contributing

Issues and pull requests are welcome; see CONTRIBUTING.md.

License

Apache-2.0.

Metadata

Release files for tabdgp 0.3.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 tabdgp 0.3.0
File Size Uploaded Provenance Actions
tabdgp-0.3.0.tar.gz 117.3 kB With provenance Details for tabdgp-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 142.9 kB

Release files / tabdgp-0.3.0.tar.gz

Download URL tabdgp-0.3.0.tar.gz
Size 117.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1b458438e0b1dcbfd12e64259d137f7612162fdd6fe8f892ad47a0c7ac13a0c2
BLAKE2b-256 checksum
How to use checksums
779662c080fdba679537a7fb9bef3db01d34ad3187d6e6c5e5747bb997dc004f
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 23, 2026.

Transparency log

Release files / tabdgp-0.3.0-py3-none-any.whl

Download URL tabdgp-0.3.0-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd48a738773b3fbe60f510f74f0acba1001af9829995d070354d2e9d4f27d61d
BLAKE2b-256 checksum
How to use checksums
db95a786294a1e6fe7b30c3868f4c04b8add7bf5db4205c50c48ae178995bc21
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 23, 2026.

Transparency log

Security for tabdgp 0.3.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tabdgp-0.3.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 Oct 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.

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