Skip to main content

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

Project description

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")

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

fairground-0.0.0a10.tar.gz (536.6 kB view details)

Uploaded Source

Built Distribution

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

fairground-0.0.0a10-py3-none-any.whl (542.1 kB view details)

Uploaded Python 3

File details

Details for the file fairground-0.0.0a10.tar.gz.

File metadata

  • Download URL: fairground-0.0.0a10.tar.gz
  • Upload date:
  • Size: 536.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fairground-0.0.0a10.tar.gz
Algorithm Hash digest
SHA256 5acb9154f07442bca8fceb4bf6c13c7a6ca0dec50e5921d8efe505f00cd51411
MD5 458255ca7567a477c32e383b7139ba11
BLAKE2b-256 eea39cd6912794272060ec053170cfc500bf2a84f6791fb49b8a0e2764928fd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for fairground-0.0.0a10.tar.gz:

Publisher: main.yaml on CoefficientSystems/clara

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

File details

Details for the file fairground-0.0.0a10-py3-none-any.whl.

File metadata

  • Download URL: fairground-0.0.0a10-py3-none-any.whl
  • Upload date:
  • Size: 542.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fairground-0.0.0a10-py3-none-any.whl
Algorithm Hash digest
SHA256 22f79248b2b75af63af530ea9956893b81922313ee6628255a3b3b999f23b66e
MD5 c763588446a0759cef90335974461c75
BLAKE2b-256 137633910d03731beea1eb0b3b5637081342b54ecd948155a42a7afb385bfef8

See more details on using hashes here.

Provenance

The following attestation bundles were made for fairground-0.0.0a10-py3-none-any.whl:

Publisher: main.yaml on CoefficientSystems/clara

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