Skip to main content

A package for managing and processing datasets for fairness research in machine learning

Project description

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

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.

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

fairml_datasets-0.1.3.tar.gz (101.0 kB view details)

Uploaded Source

Built Distribution

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

fairml_datasets-0.1.3-py3-none-any.whl (103.8 kB view details)

Uploaded Python 3

File details

Details for the file fairml_datasets-0.1.3.tar.gz.

File metadata

  • Download URL: fairml_datasets-0.1.3.tar.gz
  • Upload date:
  • Size: 101.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fairml_datasets-0.1.3.tar.gz
Algorithm Hash digest
SHA256 753930c35efd801aed512dae190d99ba5335f1b9f395518c7e38f169e7c02815
MD5 69d2472800b28067a4251d7d91525c66
BLAKE2b-256 047b962b5e90e094464616d138bf8e486e88057cc28e04c0971b88d0e04bd935

See more details on using hashes here.

Provenance

The following attestation bundles were made for fairml_datasets-0.1.3.tar.gz:

Publisher: publish.yml on reliable-ai/fairground

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fairml_datasets-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fairml_datasets-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a0348c3c827d2ed99d1d5ac79ca388eea1ce5e22c9c274259d08ac3e95e1814
MD5 ba5a7fde8072e289d89a22542da2f616
BLAKE2b-256 293aed13fa7b87ba04e445c8ae53e2da49d752a174b7877ca387d59599cbbf0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fairml_datasets-0.1.3-py3-none-any.whl:

Publisher: publish.yml on reliable-ai/fairground

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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