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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.7mWindows x86-64

solas_ai-0.4.3-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.3-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.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: solas_ai-0.4.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 914d308703961ab6fa89048b0f5989da7ad2dd585a62c8130992fa0dc7d5b5c8
MD5 20172081dd7335f58dc08426b7c8b5f0
BLAKE2b-256 c506e0ee47a13932e802224daa6ac6affe25f7c8c305987a77d69eb8aeedd787

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 95e4847211b878d17f1986386fcd246aed4c17b2ba18584b40c6193643f50762
MD5 66ff240b45df6994b1de97e46262d1e3
BLAKE2b-256 9ed4f2c8822f56e78d87dd1bb832cd3d254bb99b8a24d02fbe829c98c89cd451

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 987c2f5b19751e0d93d25e429d02b0295c3a1c13f08da3ff655b772c7ffc6eeb
MD5 5dde7286cccda692677d2d05f5e643ce
BLAKE2b-256 53d7024ad275f546d24d3c52bbbe424218944af2ad7685a666e32e148de51a72

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 75647920f657030c13f6c3b74a21b141447068d956c427d91e1a7a6b56a3e635
MD5 5b5a7dba1589049b29cda60f3d7975cc
BLAKE2b-256 bb4af1687c9664b2c77eca0149496c8c76ceff6ad2a117d20d0dca79ea132451

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 70aea0fcbf922afd526281404481973f687704503d137ba06ab07386fcce7f92
MD5 5fb8e8b43eb5b7486d68ded3a756b792
BLAKE2b-256 995dbe606d5ab82bfbaa9d1c2cdf3c12b9052f9779eb334f38fa357bd24a5c14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 90514b062fb12f161704c9374727fdcc1b0e3e27e9afbf8088b8592274bca606
MD5 739b25b4261376336ccfaf3a21b952b0
BLAKE2b-256 ca5a16085f0fc92fc11b410b53126e48578a299a2b34498f789935f193d3f33c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9f2891657944c552e8e0a4a75c8128dd6b54b7c62f1e319ecbafdd94b0ac6ca8
MD5 1675e1d3a3f605c61d6684a2b369a20f
BLAKE2b-256 50e80dadb547190af4620d2a7b07e820655736799c019e2cb40df0cc22ab48ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e0b3c8e67afc539b5af9d97331d51f2814b29506af80788c3d83bddec6b2423a
MD5 ef534c11354d861af72b6c12598b81d8
BLAKE2b-256 15b052ff597afe81b1fe6abbb3c233d50978368862589a9e6716c852af1f2156

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6338f8112389a796d5fa973e3d776da6bfe2dbb0e92fc3b21887294ab58754dd
MD5 d5fe3c68ddd0bca53dacebfc20145b34
BLAKE2b-256 6776489c79c62792d443e39a5cea116ee58be6ba25b857df5c2f33570dd80836

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.3-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.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 89f92b33d73be48befff902a0ac524029e395ce8e1548340ba672e87c665ea47
MD5 e142b2c1cde0b05aca316e0da7cfc239
BLAKE2b-256 1fdc09ee34ce0b6ddf63ee3370b8a5d90072046d867262e3e3598c6c07877104

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 aa6e67d57198334ad05f557d99380d782700aac04973a0b506189db501b4408e
MD5 478ba1ae465e46b4732e86536e41e477
BLAKE2b-256 7223023c966106810fab61121d4f4977e1753b3fb8c3eee7a7fe53ae751be391

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6dcb4792c29c961c8f63f8f028c180f23d8c505cb126d75f29679e48d9126536
MD5 b0371d96cecbc0232bb707c60a077d3b
BLAKE2b-256 15ecc0171681e9d3b228d17af929d3634873a2f0f46b52eff5a079d888f127f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solas_ai-0.4.3-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.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c829f28b28dce3420fa858c6f664a71ac4e45172e08fca4c3ed8cc9da1533561
MD5 14612a0641ebc369de8962e49127cd5f
BLAKE2b-256 807662801dcdc11bdb675b1f8528e66df7afc210d41c205983cac63fbb57b09b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2fc5a1790337870078837cc2b158058fafb6c4451ea3adc066c3ac8d65b79707
MD5 2388b0e29eb59c52a00ca7856ae00d3f
BLAKE2b-256 5cc34156556cb4f9c68cfb2d8c9613a909695e651db512013e218f71d9f92250

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.4.3-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 41cc8dea2028f6c005f047de5c928433bca9e786288160aca81c88cca2096848
MD5 6c16dfd758e2293b65eac66413c107bd
BLAKE2b-256 bd0b490d81d50274de5905eb76eaf74257d8952c243744cce1a65ccb25ea6e40

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