Skip to main content

SolasAI Disparity and Bias Testing Library

A Python Library of Curated Disparity Testing Metrics for Use in Real-World Settings


SolasAI banner

This text and associated software do not represent and should not be construed as providing legal advice or requirements for regulatory compliance.

About the SolasAI Disparity and Bias Testing Lbrary

The SolasAI Disparity Testing Library is a collection of tools that allows modelers, compliance, and business stakeholders to test outcomes for bias or discrimination using widely accepted fairness metrics.

See also:

Example usage: Calculating an adverse impact ratio

import solas_disparity as sd

air_disparity = sd.adverse_impact_ratio(
    group_data=df,
    protected_groups=['black', 'hispanic', 'asian', 'female'],
    reference_groups=['white', 'white', 'white', 'male'],
    group_categories=['race', 'race', 'race', 'sex'],
    outcome=df['Approved'],
    sample_weight=None,
    air_threshold=0.90,
    percent_difference_threshold=0.0,
)

For more detailed examples, please refer to our example notebooks

Additional metrics included with SolasAI's Disparity Testing Library

  • Adverse Impact Ratio (AIR)
  • By-Quantile Adverse Impact Ratio
  • Categorical Adverse Impact Ratio
  • Segmented Adverse Impact Ratio
  • Standardized Mean Difference (SMD)
  • Residual Standardized Mean Difference
  • Odds Ratio

Additional metrics are coming soon, including a generic customizable disparity testing function, which can create a disparity measurement from nearly any scikit-learn-style metric.

Installation

pip install solas-ai

To run the example notebooks in this repository, also install the following:

pip install notebook xgboost scikit-learn

SolasAI is supported on Python 3.7 through 3.10, on Windows, MacOS, and Linux.

Why SolasAI?

There are many good open-source disparity testing libraries already available (we encourage you to try them!). So why use SolasAI's Library?

SolasAI's disparity testing library was built by industry practitioners with decades of experience in fair lending, employment discrimination analysis, and algorithmic compliance. The methodologies included in this library are widely used across the fairness analytics space and were created to align with legal and regulatory expectations. For example, the Adverse Impact Ratio is cited by the EEOC as a standard metric for evaluating disparities in employment decisions.

Because of our experience in the field, we built SolasAI and this disparity testing library to solve common challenges that many users will face. Using the United States as an example, outside of mortgage lending, lenders generally do not have access to race/ethnicity data and will rely on proxy methodologies like the Bayesian Improved Surname Geocoding (BISG) method to predict probabilities of demographic membership. Other libraries require binary (0/1) demographic membership for testing (ex. "Black" or "White"), which is unfortunate since converting BISG probabilities to fit that format results in substantial loss of information. SolasAI's disparity testing library accommodates binary or continuous demographic probabilities, making it compatible with self-reported or proxied values with no changes in functionality.

In addition to standard metrics like the Adverse Impact Ratio (AIR) and Standardized Mean Difference (SMD), other metrics extend on the AIR or SMD to better solve real-world use cases. Some are more straightforward: the Categorical AIR, for example, allows for disparity calculations on rankable categorical outcomes instead of just binary outcomes. Others involve more sophisticated methodological changes. The Segmented AIR allows a user to account for differences in underlying demographics across some segment (ex. State, product type) and then uses a Cochran-Mantel-Haenszel test to determine the statistical significance of any remaining disparity.

Other examples of enhancements include:

  • Customizable practical significance thresholds
  • Compatibility with sample weights

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

solas_ai-0.2.2-cp310-cp310-manylinux_2_17_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

solas_ai-0.2.2-cp310-cp310-macosx_10_16_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 10.16+ x86-64

solas_ai-0.2.2-cp39-cp39-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9Windows x86-64

solas_ai-0.2.2-cp39-cp39-manylinux_2_17_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

solas_ai-0.2.2-cp39-cp39-macosx_10_16_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9macOS 10.16+ x86-64

solas_ai-0.2.2-cp38-cp38-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.8Windows x86-64

solas_ai-0.2.2-cp38-cp38-manylinux_2_17_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

solas_ai-0.2.2-cp38-cp38-macosx_10_16_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8macOS 10.16+ x86-64

solas_ai-0.2.2-cp37-cp37m-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.7mWindows x86-64

solas_ai-0.2.2-cp37-cp37m-manylinux_2_17_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

solas_ai-0.2.2-cp37-cp37m-macosx_10_16_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7mmacOS 10.16+ x86-64

File details

Details for the file solas_ai-0.2.2-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 049877661d02d1e73187340ea37c6040508c505fecd191ae34952621a456350c
MD5 b4fc30c865f52b214a5fc5f382d75750
BLAKE2b-256 33edc056bdcb392eacf6d55a1601fe658d403981f56587d79fc8f0f16ed75c04

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp310-cp310-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp310-cp310-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 a3621841f109363e55f245a7bdef9b09cc78ce501145238ebf8f65cee3f7540e
MD5 72fe3019196dd251f90ceaa8eea669c6
BLAKE2b-256 1aac9ff608e7e24ca34c1a35508e30a6437b52ecce554c455e2032404c1aaa3b

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: solas_ai-0.2.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for solas_ai-0.2.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 45898f4228787c64a30c8c31b20b70e2681cae41477be97cf129c886faece154
MD5 49aa49424917ca698cb6530884a2b7c2
BLAKE2b-256 f6a7994dd1ba7bb33123cd488b858693cc9ef14c877a496cdf4ebd3ea03fc23c

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp39-cp39-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b3d9e3884ece004a3fc146b008998a7463bd31ec26f326e5be34639a8ef0b174
MD5 39fa0f5c14ff6aa9cc7d36cf339d3630
BLAKE2b-256 fc743b3dd545b1c5823c978cee291f05fc0432235844f65f20b5e7b775379085

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp39-cp39-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp39-cp39-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 59fef0e884526d626431a2de276024b97153bfc2581cf5a3cd2ebfd8d39eb28d
MD5 25d150dd6d753f57ec850fde4611a691
BLAKE2b-256 d5a0b55ff8af86c71f63245fd8d3a235e109810534f76b426d759ee8f584eb65

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: solas_ai-0.2.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for solas_ai-0.2.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3951036251a33e8b5a11c45d4c0285515ed6e4702f0416b328c47a73217e7039
MD5 772c1e437a3a37dd0fe4c27315af351e
BLAKE2b-256 dc1d4368a1da2d322ac0818348b63f84d093d81e88fd1e5c89201150a9d41201

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bcbddd4e5eaaef26762717c350e1123f2af40681bdcdae9edeac6c436a5f17ba
MD5 c51b0ea43e310a1b4ee1406e4a60dcc5
BLAKE2b-256 6e89d57dd6ae25cd8bb1b19b2beeb4d7ac8b4bf17ed5f9f7fb1ae3e2e9e856ce

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp38-cp38-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 a1fc87556c179a08beb661432dc43637a01b115776bd910b9dcc4492d27d95ed
MD5 d1625c20bcf3872f0b76fd9021f70ef8
BLAKE2b-256 a3d1ff4d30f40da7c14ef46901cec7f07521176d80a10f37b0b84d936f585774

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: solas_ai-0.2.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for solas_ai-0.2.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3122d3da9bacb22659e9324c6b2cac5c1628604f810377345b9a04e6ed2cf1a1
MD5 8bd7ac7165055adc00aa5492b17414d6
BLAKE2b-256 a917fa24d9d1adee8e29ea96572df03bf839082f6e6deb8fd88572b2299a570f

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp37-cp37m-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 81635d7c003c04d55b057def0f2ea75404dbb8eea4c5342bf0a1c2109c318569
MD5 7382f51acfcdce6499cba1012c553fa4
BLAKE2b-256 0ac5fc5bfc7a665d4e4b8f2c5e8f542681503c470ac9f4a586a9001093706b6a

See more details on using hashes here.

File details

Details for the file solas_ai-0.2.2-cp37-cp37m-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.2-cp37-cp37m-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 2f6ab290d86efddf009f5ffa3a1742fd5709b37bcbaf244c36dfed0afa234b73
MD5 7d3f30bfc5ffcb359fc947972729d67a
BLAKE2b-256 3b75ede74f03c33947d430b95167b5debc564caea2ef6272313eef59410a7f8f

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 Sentry Error logging StatusPage Status page