Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

Pre-release

This release is a pre-release and may not be stable for production use.

fairground

CI

"There is nothing that surpasses the joy of creation, if only because through it one wins hours of self-forgetfulness, when one lives in a world of sound." – Clara Schuman

Compliance Tools for statistical analysis and debiasing for LLM powered applicant tracking systems.

Project cheatsheet

  • pre-commit: pre-commit run --all-files
  • pytest: pytest or pytest -s
  • coverage: coverage run -m pytest or coverage html
  • poetry sync: poetry install --sync
  • updating requirements: see docs/updating_requirements.md

Initial project setup

  1. See docs/getting_started.md or docs/quickstart.md for how to get up & running.
  2. Check docs/project_specific_setup.md for project specific setup.
  3. See docs/using_poetry.md for how to update Python requirements using Poetry.
  4. See docs/detect_secrets.md for more on creating a .secrets.baseline file using detect-secrets.

fairground Statistical Analysis Utils

fairground provides a comprehensive suite of visuaisation and statistical analysis tools for assessing fairness and bias in selection processes, particularly useful for applicant tracking systems and hiring decisions.

Core Features

Selection Rate Analysis

The selection rate analysis tools help visualise and analyse how different groups are selected within your process:

  • plot_selection_rate(): Creates a horizontal bar plot showing selection rates across selected protected characteristics groups
  • plot_job_selection_rate(): Generates faceted plots to compare selection rates across different job roles

Parity Analysis

The parity analysis functions help identify and visualize disparities between groups:

  • parity_difference(): Calculates the arithmetic difference in selection rates between groups
  • plot_parity_difference(): Creates a multi-panel visualisation showing parity differences using each group as a baseline
  • plot_parity_difference_scatter(): Generates a scatter plot heatmap showing parity differences between all group combinations

Disparate Impact Analysis

Tools for analysing disparate impact and selection rate deviations:

  • disparate_impact_ratio(): Calculates the ratio of selection rates between groups (also known as the adverse impact ratio)
  • plot_selection_rate_deviation_with_disparate_impact_ratio_value(): Creates a comprehensive visualisation showing selection rate deviations from equal treatment and disparate impact ratio thresholds

Key Features

  • Flexible Group Analysis: Support for both single and multiple demographic group analysis
  • Regulatory Compliance: Built-in support for standard fairness metrics like the 4/5ths rule (disparate impact ratio)
  • Visual Insights: Rich visualizations with detailed annotations including: -- Group sizes (n values) -- Statistical significance indicators -- Disparate impact ratio values -- Equal treatment thresholds

Example Usage

import pandas as pd
from fairground.utils import plot_selection_rate, plot_parity_difference

# Load your data
df = pd.read_csv("hiring_data.csv")

# Plot selection rates by gender
plot_selection_rate(df, "Gender", "Selected")

# Analyze parity differences across multiple demographics
plot_parity_difference(df, ["Gender", "Race", "Age"], "Selected")

Metadata

Release files for fairground 0.0.0a11

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

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for fairground 0.0.0a11
File Size Uploaded Provenance Actions
fairground-0.0.0a11.tar.gz 536.6 kB With provenance Details for fairground-0.0.0a11.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / fairground-0.0.0a11.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL fairground-0.0.0a11.tar.gz
Size 536.6 kB
Tags Source
SHA-256 checksum
How to use checksums
40888cb21fc896d629149c458e2c4e0c16a2ec24d63b3285d9a67d4c05ac5792
BLAKE2b-256 checksum
How to use checksums
d3b966f9e44f19cd162a62a68ab49e4fdee99e79e6a85c7800d7a8732b61b483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.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 Nov 5, 2024.

Transparency log

Release files / fairground-0.0.0a11-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL fairground-0.0.0a11-py3-none-any.whl
Size 542.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b544cb5ee2f1e8ce8661b3935634fc4990d0e2d891e5f4a22c678465d499e61
BLAKE2b-256 checksum
How to use checksums
ff5fccf41e34ad5a0f2cdff346e4cb9ea2f266809bcbe05798878ef06e7877f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.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 Nov 5, 2024.

Transparency log

Security for fairground 0.0.0a11

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.

Change of provenance

The repository and configuration that created this release differ from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for fairground-0.0.0a11.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 Nov 5, 2024.

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