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

Uploaded CPython 3.11Windows x86-64

solas_ai-0.4.2-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.2-cp311-cp311-macosx_11_0_x86_64.whl (14.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

solas_ai-0.4.2-cp310-cp310-win_amd64.whl (14.1 MB view details)

Uploaded CPython 3.10Windows x86-64

solas_ai-0.4.2-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.4.2-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.2-cp39-cp39-win_amd64.whl (14.1 MB view details)

Uploaded CPython 3.9Windows x86-64

solas_ai-0.4.2-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.4.2-cp39-cp39-macosx_11_0_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

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

Uploaded CPython 3.8Windows x86-64

solas_ai-0.4.2-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.4.2-cp38-cp38-macosx_11_0_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

solas_ai-0.4.2-cp37-cp37m-manylinux_2_17_x86_64.whl (15.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

solas_ai-0.4.2-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.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: solas_ai-0.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 14.1 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 690dbc0fc7308d7847fe773ded0ebc1b5636145c9960a71c5103d1ca2ee0b8e1
MD5 6299c9eb55944253269fb6cb2ce0ae3f
BLAKE2b-256 1b47ca9d81a6bb9c43e75938ad8c219a06f27734fe0de9521ed1d09140953c3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 76829b2d14b75757758df57cb22dcf076dcae561466b7c21852e6022d81641ae
MD5 2739f967fc856b74f6dd97f3855c53c3
BLAKE2b-256 686530dc6679a5ebc621bdc542be4a84c59068109528fbaf70934eb0687065f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fe18b3fd514d254b0533d91b894290b349b7b3d84be6fe65b6053514d64267da
MD5 594001a0ab681d407f3108085f473e07
BLAKE2b-256 35eb41ea3a7752a633fa87d51a3a20d0dd32778e523a07690a2fb62c556715bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.2-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.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a5692f89a15ff66a8da019854e4fb1942c91a4c927ada92d78ee8b0e96f4cf3e
MD5 ad7ff988829ff657911a86e846b26dc1
BLAKE2b-256 6709f2692863fb5d40e418e67b1876bdaf4d1799802de3d5e7a54ed785ec74b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a6ea44fc859efb7650d4e1112d112bcf3c6d74773d9602aba8a443dd520fdcc3
MD5 57bbfc13762b35c084fb7f3670b922d5
BLAKE2b-256 f5fd0c033957de43a4d36ac29ecf34e131cb75760e2084bcc2313bf1320a9626

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 ca3fede50af524ef219065d349ceb27a21dfe5b9803a571f53793043f30ed9b3
MD5 1391a07850f33de55c539aeff9d80d81
BLAKE2b-256 60563eb31559437413fe23f7cd6f22c2eee85c7ccc7991c4e4b6cf95f808c289

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.2-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.4.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 103f1c09e6ab7c9b45ce299123f3dfcec737582c6f46eb4e5234f3c24ff7ea71
MD5 0cfaed4f603b7fc88944ed3534553a88
BLAKE2b-256 56905dc84b4d93e954ad92582f31a0d67ba871862daaa8a03aa20e99dfc48a5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 99482def245af95179dbb963782c3290191e509418385274969228f028aef0fc
MD5 e009cef34b39f1bb4990a29ccecf4170
BLAKE2b-256 ee3f41a29c20f5d770d2e36b0c75da01d50e4c09d4050a39188533282ab47dc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 89da48ec43851dd2a1982e8b440f4b1a3baf2591baae9b8e760c172dadd7dad7
MD5 d07b4f71bbe5941f6224094ca4985bdd
BLAKE2b-256 b8237fe5e59670814aa004feabb58c7ad23d97ff010f14893d1da15c70263192

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.2-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.4.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 833016a90c7d8624e2fd153dc05ab9387e14ddab097f5292ce08512cddcfca45
MD5 4a2076ca866fef97612ead882571185d
BLAKE2b-256 2aa7d34c417c649b0f48ac56eda39ab3ceafdf604618c27b9de59c11ec19ff21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 72e108b3e5a480bd61fd3c1189cd3ca1a678e25d564a9ba7ef9f3c56cc2256fb
MD5 ec3195f769efae6261783f25f379d62b
BLAKE2b-256 a490c3d4a6c9dd96ab31b0fb7ff1c18ad00741e9bdb4d8bdd43df798007a3bac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 91b7082943dfd98d64ad07b7baa0e2098c51f1673e1417b8bdbedc3eb0480f9e
MD5 49ec343c09ffc7386e9557ec87a22d8c
BLAKE2b-256 bda8c8df6b2e725202920a97001ce9a9f433abb1b61516673d903382eb481496

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.2-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.4.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fe8c3815d19036eca2e5e9c42a46cad3e121f77af3437a8d7714e5cf15271c95
MD5 c9cfe786a598ffa20ad4f920bb566d20
BLAKE2b-256 f54f8e65269e61e98d88a3e7328c0cf7f16caf6c07bb3f631ce5eb4a9efb4a43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e8da646d2e42968a9de612ce949b938a3dfaa90e6e94fc1be462d8696392d7b4
MD5 e834d9a305bbbeaeec3e87e76b8b2d34
BLAKE2b-256 57b20e6f366e06da95528bc35f557083f680e8f655e43b7e78395f171291cf74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.2-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 ed88e34375abfc348b8db6147b38dbb69a97ede3ecf394b5dd5899acaa9abe77
MD5 67a3d6f462ba214c7285f97021a2bd37
BLAKE2b-256 4dca64c202f412b968d20fdd031b6dfb35c097120c633425e7f7d5c43b5dff8f

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