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.3-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.3-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.3-cp39-cp39-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9Windows x86-64

solas_ai-0.2.3-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.3-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.3-cp38-cp38-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.8Windows x86-64

solas_ai-0.2.3-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.3-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.3-cp37-cp37m-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.7mWindows x86-64

solas_ai-0.2.3-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.3-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.3-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6fb7b94ffb7dd6cac17dafc9f4b8e9a0e17e4cdb0c243bac55f2e05434553fe6
MD5 d9140cb0326c7fed787f2d3ddd1c3082
BLAKE2b-256 b221d60893714fd2631b1b1d9bd5b279c720ac67e30ee2179ef38a8334d8ebb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp310-cp310-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 35f3fe058b6edbea4537cd25148950c00e5234e3083d419a9c49d2da3aef2aba
MD5 5238a2fb316c288b419e81a858b31a07
BLAKE2b-256 081f0285869d5dde51954c54ca364ab3f7666bb59d2ecf3a73f39c2ef7bf58d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.2.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2ae531b937c6414a2b00785a9036fdea6667d7883eb90ff1cc9ac5e248fe7d05
MD5 3011213d0932141c776f1bb8f88956bf
BLAKE2b-256 a5f2b9fed7a5e8a32ff06a935e57683ac5515f6ae05465d6e6f3191ac25ffacb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 886ff6c4cef6aceb5952671fdf7837787c54fb906f4a844cbbda1b905dfceb6c
MD5 18b516c78fd60e7b412ea11b532990e0
BLAKE2b-256 b4742694aec7a899a7d1141f94d7e988d044912a87c42b028bd5b20e9f172050

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp39-cp39-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 2490125bdcfd49651ccfe90c310e437552ef7e505ec0ac3f6bd58122dacc53fb
MD5 1059eb317f2e30784edae8791b70e972
BLAKE2b-256 8703dff1c2ecfabed9eb2fa82da64ad017cd4ca2ca75ccf7a869481795f12ef6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.2.3-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.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ada121133eb026ae230cc35cc9e898852c1e0b520f78385bc04c8ee48d347a6d
MD5 5960e9002852f24b0b142a08cfd06e91
BLAKE2b-256 47d3cdc5e136dc8b087dc31336abeae4348659f72788b557f24d1fb5851f6325

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c95344cb29f2b0303f21a5b02860320a911d713a7061bd8fafd205a2ee4a9d9f
MD5 59dcb600b3b95cb1018b84ebe35dba8c
BLAKE2b-256 ed4e13e6b39febf763c7e060f955e0fc5a0437895b7efca3508c8ebed751315f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 5526858b4365eb80de1e19ddbbaf294abb368aa5fd77a86e1385c46843a3dc26
MD5 1a999fc1c26c6d38382dc769d5a68cb7
BLAKE2b-256 16aafb2fc57d6591b4b5b320cc20712da1d769b467c512f55fae49c9d220fa4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.2.3-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.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 14c2c0f667c3ed08eba71e2bb5a6cfe21ea266567504dba5d687aae5eeb0bedd
MD5 52c189446266baf25f95b6d3571938d5
BLAKE2b-256 1fed3eec37cdef8f43e8b6f8196f22f8ae473210444782b5a1b4e88b4fc5b3bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c3195022ca19a563f7d61eeb25e80cf7f0e1e88cc1532678c2183fb6fe6d8f21
MD5 070c9ddd9ea0bb6c996aedc2142650c7
BLAKE2b-256 ee4910f33afc4d1d1918480c92ed832ee78813e5e09b5080cb09c01c083a2fff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.2.3-cp37-cp37m-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 82f622a512e9536b1f5217f56607158ecb090549c918fe118e87b00274cfb9ca
MD5 12fda43d05f92b8b434c94f17af0d720
BLAKE2b-256 7921c59ed29db3299c9b0307a940376a5a376049b207d0a4b187181e6d87dd1e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.0

19 files

0.5.1

11 files

0.5.0

10 files

0.4.4

15 files

0.4.3

15 files

0.4.2

15 files

0.3.10

12 files

0.3.8

11 files

0.2.4

11 files

This release

0.2.3 This release

11 files

0.2.2

11 files

0.2.1

12 files

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