Skip to main content

Fast Fair Tabular Data Generator using Autoregressive Decision Trees

Project description

TabFairGDT

TabFairGDT — Fast Fair Tabular Data Generator using Autoregressive Decision Trees.

Generates synthetic tabular data with built-in fairness constraints via leaf-relabeling of CART models.

Installation

pip install tabfairgdt

Quick Start

import pandas as pd
from tabfairgdt import TABFAIRGDT

df = pd.read_csv("data.csv")
df["income"] = df["income"].astype("category")
df["sex"] = df["sex"].astype("category")

dtype_map = {col: str(df[col].dtype) for col in df.columns}
# Map pandas dtypes to tabfairgdt types
dtype_map = {
    col: "category" if df[col].dtype.name in ("category", "object", "bool")
    else "float" if df[col].dtype.kind == "f"
    else "int"
    for col in df.columns
}

generator = TABFAIRGDT(
    protected_attribute="sex",
    target="income",
    criterion="dp",          # demographic parity
    dtype_map=dtype_map,
    seed=42,
)
generator.fit(df, lamda=0.5)   # lamda=0: no fairness, lamda=1: max fairness
synthetic_df = generator.generate(k=1000)

Parameters

Parameter Default Description
protected_attribute required Column name of the sensitive/protected attribute
target required Column name of the target variable
dtype_map required Dict mapping column names to dtypes ('int', 'float', 'category', 'bool', 'datetime')
criterion "dp" Fairness criterion: "dp" (demographic parity)
lamda 0.5 Fairness–utility tradeoff passed to fit(): 0 = no fairness, 1 = max fairness
acc_threshold -1 Max allowed accuracy drop as a fraction (e.g., 0.05 = 5%); -1 = no limit
seed None Random seed for reproducibility
parallel True Use parallel fitting across columns
re_order False Reorder features by correlation ("corr_asc_target", "corr_desc_target", etc.)
smoothing False Apply kernel smoothing to continuous columns ("density" or column dict)
proper False Bootstrap training data during fitting

Citation

@inproceedings{panagiotou2025tabfairgdt,
  title     = {TABFAIRGDT: A Fast Fair Tabular Data Generator using Autoregressive Decision Trees},
  author    = {Panagiotou, Emmanouil and Ronval, Benoît and Roy, Arjun and Bothmann, Ludwig and Bischl, Bernd and Nijssen, Siegfried and Ntoutsi, Eirini},
  booktitle = {IEEE ICDM 2025},
  year      = {2025},
  url       = {https://arxiv.org/abs/2509.19927}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tabfairgdt-0.1.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabfairgdt-0.1.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file tabfairgdt-0.1.0.tar.gz.

File metadata

  • Download URL: tabfairgdt-0.1.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tabfairgdt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74f875b0e90603b0ad6c1028b0bfdac2a4fe5c666f2a7e9c98f2974563aa13a5
MD5 8c15d1c419cb046396c05f3f48d434a4
BLAKE2b-256 d9a88947dceba6004b4ccd908c8f7886e0ab864631c22994015cfdcc1db37d6f

See more details on using hashes here.

File details

Details for the file tabfairgdt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tabfairgdt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tabfairgdt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40637f9b493025ebc3027b91644335081d3bc7237c36d2019be62eed220c6937
MD5 5e337b98df958b648bed11bd53b01aaf
BLAKE2b-256 8149d816369fcb6d18f93e1a8746be99c6acb599f827a88d5e24932530219fe2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page