Skip to main content

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

Project description

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

Project details


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.3.10-cp310-cp310-win_amd64.whl (14.1 MB view details)

Uploaded CPython 3.10Windows x86-64

solas_ai-0.3.10-cp310-cp310-manylinux_2_17_x86_64.whl (16.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

solas_ai-0.3.10-cp310-cp310-macosx_12_0_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.10macOS 12.0+ x86-64

solas_ai-0.3.10-cp39-cp39-win_amd64.whl (14.1 MB view details)

Uploaded CPython 3.9Windows x86-64

solas_ai-0.3.10-cp39-cp39-manylinux_2_17_x86_64.whl (16.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

solas_ai-0.3.10-cp39-cp39-macosx_12_0_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.9macOS 12.0+ x86-64

solas_ai-0.3.10-cp38-cp38-win_amd64.whl (14.1 MB view details)

Uploaded CPython 3.8Windows x86-64

solas_ai-0.3.10-cp38-cp38-manylinux_2_17_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

solas_ai-0.3.10-cp38-cp38-macosx_12_0_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.8macOS 12.0+ x86-64

solas_ai-0.3.10-cp37-cp37m-win_amd64.whl (14.2 MB view details)

Uploaded CPython 3.7mWindows x86-64

solas_ai-0.3.10-cp37-cp37m-manylinux_2_17_x86_64.whl (15.8 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

solas_ai-0.3.10-cp37-cp37m-macosx_12_0_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.7mmacOS 12.0+ x86-64

File details

Details for the file solas_ai-0.3.10-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: solas_ai-0.3.10-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 14.1 MB
  • Tags: CPython 3.10, 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.3.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 956bfaa7ceaee73292fabc1e878e2eff347bca6f0cd47d24e0f238fc5c948ee2
MD5 7f4e84a5b31954b0ad45e2c46ac3e5f7
BLAKE2b-256 209fd229803135f9c11289b7473559c5804e44f3885722ac94d4f4e80319e8b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f03a6cdac70bee8a27449a592c87800f99625169d2db89f230af7454f8709d4e
MD5 7be8d21ce07fec08eb4e329d13e52f2d
BLAKE2b-256 6148541fc91708649ac5093ae915c68822f3530468963a5b7e197955c2e1bd4c

See more details on using hashes here.

File details

Details for the file solas_ai-0.3.10-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 449da696480425ff75cf46b2ed87610abd96470ed86b652a1f28c573cb254511
MD5 2b9621664cec1ad65546746d5fa1778a
BLAKE2b-256 bb09ad5072fce5a116754dcc2010e4cd5e4f0a7428915bbdd040437c71f9f81a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.3.10-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 14.1 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.3.10-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fcc7e642d254419ffd3bc1643d61c5e6346dda7431e34eef90fcd4d53f0ccc73
MD5 6e6bd15eaa79b157e323859b51eba4ed
BLAKE2b-256 1c38fdd92d432f010ddb9060d2790a7dfc72aa35cc23e03560fdfd9c6cba6286

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 05267cf482eb10b7bdaf4d46cf4a24dc93c188e0f7ca2e3f54782f027b16d2a9
MD5 799710a5294dcbbab440b7a215837c6f
BLAKE2b-256 d9963f1853f40b2158854c91c276d7585da3ab0e287e536be39fd64f34766860

See more details on using hashes here.

File details

Details for the file solas_ai-0.3.10-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 54065f0457e7d0bcb2db27bf4788a287f2452c36fef0c4109c3d1d56dfc4e480
MD5 6eba203933f5df47050e48ab047f39ea
BLAKE2b-256 e1363fd180246b77a4e8aa9b412295f0cf160e2e3c404325141978cce72f7b3a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.3.10-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 14.1 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.3.10-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 66ac30e86612e0de314ad103fb0cf9ec3eed65f4bdd6e1986b2918be05bbb779
MD5 2d6246824cb0757fe73f593d5a1b5df8
BLAKE2b-256 f3511cf28495b3994315605ff98f7108c68ee30378e89de262898e64b689b97d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5796f2fe8feac3d3dd40aaf04f0333d2cbf0f16e4fc8af47204f60bb289fd54a
MD5 5ece6338c1f6a3bc65b0272dca09ffbd
BLAKE2b-256 c64c9e251f51a39f66e19df687dcc5c8937c6804563c0deeb3b6a83a773e913e

See more details on using hashes here.

File details

Details for the file solas_ai-0.3.10-cp38-cp38-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp38-cp38-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 d557a2d3a8ca216ffe4ba12603f420c27ba03036b6f50211385c9ca3d9879930
MD5 ada65b77873b7bd80426f3ab4c6d4d48
BLAKE2b-256 3f39ee3961b554724e92b5b5dccdfc26c90dff28682e4efa4440f9578647a93e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.3.10-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 14.2 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.3.10-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a654b0cdae4c120217e1ea362bd173cd5e245b98dc75e2bfe7614daf736195f3
MD5 d0cdac91db59d3d005266fd2a03d7188
BLAKE2b-256 3b6c4c7759767442e69cfd39acc7d91b09bb2a65c324ae373b45a7bc141c3555

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 356bf064e08a586ea5ce54ccca24fb28289b8e76cc783fc970c1820664991017
MD5 67db42241cf33367c68fae4deec1af5e
BLAKE2b-256 50a075c169dcfbb0c2b192d00c7472b6c09ff7144ac8c7ac89c740807a565144

See more details on using hashes here.

File details

Details for the file solas_ai-0.3.10-cp37-cp37m-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.3.10-cp37-cp37m-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 c11e7249ea89c18d17109f1f3352a0dc1c93cd04fda8a46b0f2afabd4cdf764f
MD5 e25b3db6e270ca11e513a70db3edf24b
BLAKE2b-256 1dc5a44d82d545f2f0f387889bbcc5c617a39f8a5828a6977d122838cd9a5eaa

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