No project description provided
Project description
SolasAI Disparity and Bias Testing Library
A Python Library of Curated Disparity Testing Metrics for Use in Real-World Settings
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file solas_ai-0.5.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
43fab710815e939696b2ea786252ac2d7cfc68d035a2556ee94a0a0a8fb1eb79
|
|
MD5 |
8ed27d8b2143cd008fe1aebe84b54c5d
|
|
BLAKE2b-256 |
733bb4b51218fe167e5428d812348ee2068da63da8f6fa54d7c9de28bd5057d3
|
File details
Details for the file solas_ai-0.5.1-cp311-cp311-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp311-cp311-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
88cb78ed85580daca1cf7f73b6d6b49377f36d739be33a8379649fb9af7e4406
|
|
MD5 |
06b621286dbd60522771b5a9b90bd2f5
|
|
BLAKE2b-256 |
6810a9fbadd597bede70876f3a86c1099649ba4c8b1cb6b264654a73b0c3e132
|
File details
Details for the file solas_ai-0.5.1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7ef3f60a697c63980dd81840e2da217083224d653a2458b53eb520ddc80ced27
|
|
MD5 |
258c6112ee5e2088ffce3d7536583978
|
|
BLAKE2b-256 |
e5f10a5475bfe737019f483fdef0ff5dc201f1ffd55a8a8005670574cf2ee07c
|
File details
Details for the file solas_ai-0.5.1-cp310-cp310-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp310-cp310-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
41665f5c4696387100afef6ac9ea5b357e6883c27a67edf1d12ceb3361245f50
|
|
MD5 |
fba5ff37ed9cddcb7ee583195b03229a
|
|
BLAKE2b-256 |
ab6687c3259feab73d7c75c3f7a5ca7c856d7c288481b70980897c24f01686b3
|
File details
Details for the file solas_ai-0.5.1-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
18bad6127344070065beb4064799e433fc772e85f6ef69a3703bc0c47812a71d
|
|
MD5 |
337d360551482e590aea3e9eb8430469
|
|
BLAKE2b-256 |
68e445b6c2a140d7bda2f8b63c18b9ec14b6980ec06e022564bcb41c45666b23
|
File details
Details for the file solas_ai-0.5.1-cp39-cp39-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp39-cp39-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
bf540ddfa3ba7780454feafe93b9f310fb7b33d911de24ec990e46485b0648d4
|
|
MD5 |
73bed34354182443a2913da7f55d09c4
|
|
BLAKE2b-256 |
26b587c3e77e266c2ff0f3f84cdd36979f1c79a1b3f0d02e4eafcb9ef811c4fa
|
File details
Details for the file solas_ai-0.5.1-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
49ea526e17620780d81ed2f801699b3b0d9ca7ea05422371c2e62fc1f2a7c8b2
|
|
MD5 |
c013a3bc2e3c05bbd09edbae3e47dfb4
|
|
BLAKE2b-256 |
6c4e680a101dd43e5ee6d470d277c09702ce2d64717be77e69a1dea7cd9b6f9a
|
File details
Details for the file solas_ai-0.5.1-cp38-cp38-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp38-cp38-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a3e60172a4e34e912b40566910244a2589d6b87905db9e28a9489205f7cef5f9
|
|
MD5 |
0e7b82e310ad360adf0c5583ea960cc9
|
|
BLAKE2b-256 |
9e77e1c91711b8e39a550f21ca1019588e24c89d0c236e236f6e1bcc9e53cd7a
|
File details
Details for the file solas_ai-0.5.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
49c6c50cf4b6ec4e1f1de4cf437292469b0b8321c05f40de747d56626b1ffbf2
|
|
MD5 |
4a49bb405dbfe751c71a55e74aa408f1
|
|
BLAKE2b-256 |
f7a14e9717280f8d14ef1c4c057ac8e4cd29007ada4ef19b9155d355baa83aa6
|
File details
Details for the file solas_ai-0.5.1-cp37-cp37m-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: solas_ai-0.5.1-cp37-cp37m-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
f4143953f5c5b5377cfdda395f9cf57e98e7204e713f0c3874b80c67c097751a
|
|
MD5 |
22be29eb0aed95f3cc7449e29fce0650
|
|
BLAKE2b-256 |
ae0c074b9c8f5d2b1d8ecea8c9e601c2eb7607fc2eb09759226767e9e4cb4325
|