Skip to main content

faiground logo

FairML Datasets

PyPI Tests

A comprehensive Python package for loading, processing, and working with datasets used in fair classification.

Overview

The dataset preprocessing pipeline supported by the package.

FairML Datasets provides tools and interfaces to download, load, transform, and analyze the datasets in the FairGround corpus. It handles sensitive attributes and facilitates fairness-aware machine learning experiments. The package supports the full data processing pipeline from downloading data all the way to splitting data for ML training.

Key Features

  • 📦 Loading: Easily download, load and prepare any of the 44 supported datasets in the corpus.
  • 🗂️ Collections: Conveneiently use any of our prespecified collections which have been developed to maximize diversity in algorithmic performance.
  • 🔄 Multi-Dataset Support: Easily evaluate your algorithm on one scenario, five or fourty using a simple loop.
  • ⚙️ Processing: Automatically apply dataset (pre)processing with configurable choices and defaults available.
  • 📊 Metadata Generation: Automatically calculate rich metadata features for datasets.
  • 💻 Command-line Interface: Access common operations without writing code.

Installation

pip install fairml-datasets

Or using uv:

uv add fairml-datasets

Quick Start

from fairml_datasets import Dataset

# Access a specific dataset by ID directly
dataset = Dataset.from_id("folktables_acsincome_small")

# Load the dataset
df = dataset.load()

# Check sensitive attributes
print(f"Sensitive columns: {dataset.sensitive_columns}")

# Transform the dataset
df_transformed, info = dataset.transform(df)

# Create train/test/validation split
df_train, df_test, df_val = dataset.train_test_val_split(df_transformed)

Are you curious which datasets are available? Check out the Datasets Overview in the side bar to see the list!

Command-line Usage

The package provides a command-line interface for common operations:

# Generate and export metadata
python -m fairml_datasets metadata

# Export datasets in various processing stages
python -m fairml_datasets export-datasets --stage prepared

# Export dataset citations in BibTeX format
python -m fairml_datasets export-citations

Development

Development dependencies are managed via uv. For information on how to install uv, please refer to official installation instructions.

To install all dependencies, run:

uv sync --dev

Formatting

We're using ruff for formatting of code. You can autoformat and lint code by running:

ruff check . --fix && ruff format .

Tests

Tests are located in the tests/ directory. You can run all tests using pytest:

uv run pytest

License

Due to restrictions in some of the third-party code we include, this work is licensed under two licenses.

The primary license of this work is Creative Commons Attribution 4.0 International License (CC BY 4.0). This license applies to all assets generated by the authors of this work. It does NOT apply to the generate_synthetic_data.py script, which instead is licensed under GNU GPLv3.

The second license, which applies to the complete repository, is the more restrictive GNU GENERAL PUBLIC LICENSE 3 (GNU GPLv3).

Please note that this licensing information only refers to the code, annotations and generated metadata. Individual datasets which are loaded and exported by this package may have different licenses. Please refer to individual datasets and their sources for dataset-level information.

Metadata

Release files for fairml-datasets 0.2.5

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

Source distribution (sdist)

Source distribution for fairml-datasets 0.2.5
File Size Uploaded Provenance Actions
fairml_datasets-0.2.5.tar.gz 104.1 kB With provenance Details for fairml_datasets-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fairml-datasets 0.2.5
File Interpreter ABI Platform Actions
fairml_datasets-0.2.5-py3-none-any.whl Python 3 none any Details for fairml_datasets-0.2.5-py3-none-any.whl

Total release size: 209.4 kB

Release files / fairml_datasets-0.2.5.tar.gz

Download URL fairml_datasets-0.2.5.tar.gz
Size 104.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cfac32b0a88104c16317ba99b61239ea8e8dd67ce1ebe3e7bb33fde069630f8c
BLAKE2b-256 checksum
How to use checksums
31ad74f20c9c19fd3749f43a9174dfa01df138b195b0f8161b2aa29bc875cd4f
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 Dec 17, 2025.

Transparency log

Release files / fairml_datasets-0.2.5-py3-none-any.whl

Download URL fairml_datasets-0.2.5-py3-none-any.whl
Size 105.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa5eddf9d0b5334fc6bfb8137952876a3970d5e182c7622d9b2c149dc651f8b2
BLAKE2b-256 checksum
How to use checksums
c32754b01ec9b56bdc0d20c86d08df491eb9dfe07e54c03a3a786351797cd2cc
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 Dec 17, 2025.

Transparency log

Security for fairml-datasets 0.2.5

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 fairml_datasets-0.2.5.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 Dec 17, 2025.

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