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.4.4-cp311-cp311-win_amd64.whl (14.2 MB view details)

Uploaded CPython 3.11Windows x86-64

solas_ai-0.4.4-cp311-cp311-manylinux_2_17_x86_64.whl (16.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

solas_ai-0.4.4-cp311-cp311-macosx_11_0_x86_64.whl (14.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

solas_ai-0.4.4-cp310-cp310-win_amd64.whl (14.2 MB view details)

Uploaded CPython 3.10Windows x86-64

solas_ai-0.4.4-cp310-cp310-manylinux_2_17_x86_64.whl (16.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

solas_ai-0.4.4-cp310-cp310-macosx_11_0_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

solas_ai-0.4.4-cp39-cp39-win_amd64.whl (14.2 MB view details)

Uploaded CPython 3.9Windows x86-64

solas_ai-0.4.4-cp39-cp39-manylinux_2_17_x86_64.whl (16.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

solas_ai-0.4.4-cp39-cp39-macosx_11_0_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

solas_ai-0.4.4-cp38-cp38-win_amd64.whl (14.2 MB view details)

Uploaded CPython 3.8Windows x86-64

solas_ai-0.4.4-cp38-cp38-manylinux_2_17_x86_64.whl (16.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

solas_ai-0.4.4-cp38-cp38-macosx_11_0_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

solas_ai-0.4.4-cp37-cp37m-win_amd64.whl (14.3 MB view details)

Uploaded CPython 3.7mWindows x86-64

solas_ai-0.4.4-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.4.4-cp37-cp37m-macosx_11_0_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.7mmacOS 11.0+ x86-64

File details

Details for the file solas_ai-0.4.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: solas_ai-0.4.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 14.2 MB
  • Tags: CPython 3.11, 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.4.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b204fb6ed349980b90d2059f94d659a7c59ad228ad17e416619b49a3632054d6
MD5 88807986709dc4333b0a5de4bcf6f21d
BLAKE2b-256 af3367b9fd33c4558d6834fd69b5b2d3e7c1e1b83c0a43aff02217d8a6a0361f

See more details on using hashes here.

File details

Details for the file solas_ai-0.4.4-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7531e61d816ce951c3ea31381c1b3c0bb7922d1103ce68f73518047a835855fc
MD5 87036e6c26d8a0f2d1213f00c17193d4
BLAKE2b-256 bc49ae3a8a165a2020022bccf481d1885a2edb441a3801225f032e58c1c1216c

See more details on using hashes here.

File details

Details for the file solas_ai-0.4.4-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 2feb35cf25dee054a14619829562e624758690a149f2d5bc687d6f589f540b67
MD5 5f1e68eeb63b5c895e66dc5baece1423
BLAKE2b-256 6b6cdb821674cc551e0d903da05c8d6ba79546a0a7ff83c348b0d08e982f4969

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 14.2 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.4.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e755b623030370c1c29c7b46ccf4f5be9c6e30db1c6cdd67441d2acf6ab14ad3
MD5 8c4cfcaeb968f909e2e1f5c6b47de4a4
BLAKE2b-256 f7aa58780a0365d76f4f8f993735506cd5fbb2a34be44a510e8615b9630c7d06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a023b2d077bbb7219cd3a1cbadaa312756a25e148ff77257284378468e1a7353
MD5 5614f7661a522ef71ebd327d687aacb6
BLAKE2b-256 c45371317e7241ffcdd3acc7d7474d23dc93be5895c6f3f5d536cf1f18e9665c

See more details on using hashes here.

File details

Details for the file solas_ai-0.4.4-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a3e6c434aa370f7ac56b44f38d7a39f2e2338871f879464b5e4eba01b36b288c
MD5 48b3fce0ec4cfa66309b2cdb9129e2a6
BLAKE2b-256 a07d86666374b3ea7c992a88bcba310f276cd8a95bb980c0f60fec91044a3f20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 14.2 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.4.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e889f79c4f31de07c7e935b37a5ede244601ff962fd171b5f25dd0783a274db1
MD5 3bdb3f368aed7df7a6805775e3f58119
BLAKE2b-256 e213c01810db1d63f6325765e7ce3f186aaa9890768430cbf96641732055a1d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7c788f52733fb8c8f4109478c3867b8ec4d2cf1a13adc26c0b3790ca6b8cc1cd
MD5 18887bde5b604828e5beb6ee7329ec95
BLAKE2b-256 fee4d70f8ff6461c8eb0a78a301f1e8859202d532b3ace04c519296b6f041741

See more details on using hashes here.

File details

Details for the file solas_ai-0.4.4-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cdd657663ae1afdc70ce08826b2365fef4d64e7650593cbd3272f2f3b543bc82
MD5 26bd0fcf8b63c3dd1006d7ac37df1bf2
BLAKE2b-256 827560c661add6f3cd1df58e94e7876441a6b7fb2b5a5feb00b43191a25bf90b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 14.2 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.4.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 1c640c9d37b0892824e6deba116cfd99a1eb77b74c7845ed05954da846d2c257
MD5 450aa862bf5fa5efb6e6b0b7ff242e09
BLAKE2b-256 19b12a8ff666c1b04b423d6cdbe3aeb8613b8e28455bbfd54534170620b18974

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 386fcb82b7d79a6e53de1606f4a7ece67a3b74da3700523e643298a0b34272a3
MD5 8ab272d2b340c0357f6984365a25b198
BLAKE2b-256 624de4d7c2f3a7cb14616befb11f926ad2cb099bfa5172662a49260d98de38e9

See more details on using hashes here.

File details

Details for the file solas_ai-0.4.4-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a14113a3f7a0eeb2efc245be42b224fbd379a0a37e31f2d497bba8bc8a2f2845
MD5 f5a93eaca78c3bef6040b22d98aade91
BLAKE2b-256 d61c0aeaada4092d7a466b4b490bb945547b4d0b5d30236f078a42d14a4b911d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.4-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 14.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.4.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 14cb64d05782f4c425cdfffe11330d6ca8d33850b7f908b862847187576a36bf
MD5 4c5e53a8eaa8d43e48c599ddc7ffc13e
BLAKE2b-256 dcaa1d051c8e792facf13725b9d9f40d4c881cc617425748ddbb9cb781e1c443

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8d126f08e0221a31e514235088155df6257d0a6855fa846cd89a8a1e23e246ed
MD5 f52de47976ab55cb19756ba8c0a6fe49
BLAKE2b-256 d4046d155e5605f2e1c6a10225726f07f4843310f042cfbfa625b85b6e01f39a

See more details on using hashes here.

File details

Details for the file solas_ai-0.4.4-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for solas_ai-0.4.4-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0c935a7832cefc6fe569d2c22314896420d98df39acdb06b6f8f42ec8ce2f8a7
MD5 8403b43c412e0ff1982d4dadbbf551e2
BLAKE2b-256 a0877483d7c9fece9d562de469b625ff91a9ed61ec8ebf89e28cf90af28e1d7a

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