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

Uploaded CPython 3.11Windows x86-64

solas_ai-0.5.0-cp311-cp311-manylinux_2_17_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

solas_ai-0.5.0-cp310-cp310-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.10Windows x86-64

solas_ai-0.5.0-cp310-cp310-manylinux_2_17_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

solas_ai-0.5.0-cp39-cp39-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.9Windows x86-64

solas_ai-0.5.0-cp39-cp39-manylinux_2_17_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

solas_ai-0.5.0-cp38-cp38-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.8Windows x86-64

solas_ai-0.5.0-cp38-cp38-manylinux_2_17_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

solas_ai-0.5.0-cp37-cp37m-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.7mWindows x86-64

solas_ai-0.5.0-cp37-cp37m-manylinux_2_17_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a3f505e5d1f1a2f75f82910cb37b3a4c68ae0d630bacd41b699db3f42610b6db
MD5 9acc1069368e591cf1e36e23a71e1de8
BLAKE2b-256 8cff1f2c5713eba7752f80b54e452d96655499fefb37156b7b922a56111eb960

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 537ebd1a83e127316e1e1de2a20501d79c1f3b3d7bc5aad0adecc0faf5e09954
MD5 30aed21bb70ecf43ef4147ed43841206
BLAKE2b-256 699ff09b7c16d8327313f37be3e2d186406e09155e0aed37ad343cefb3ed23cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1126aac382d83be311ee5d8999920f98c936548a554bc4c2488cffcfa3fc4049
MD5 ef47638e678162063b4bbf550c5468e3
BLAKE2b-256 5165be6d0add7f9a65d8aad4a5981b52701148e77d003de346e8be22afaebb37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 60b8421d33407bb921b855fc0ea86ed2148cb8f49d3c3b71c241bd7d15f6a7cf
MD5 9d97a686bfc400052bd450bf3dc260bc
BLAKE2b-256 82feee9472501727e9b947097bfd08d0dba1c7be459294548ce9ab1acbb80889

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 aa352b5303aa133d8e3e52e47a0829bc0683e2ebd0532522169aaa72a3cc4446
MD5 82e4448f71f97ce25e6c11c27790b7bb
BLAKE2b-256 b77936647c38c6ac874ecf791cd7c37181e281eabdec61d11f0459723b2c1b2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c56ebd9fdfc4787b1b36f00cd3d9263d58b81f141f4e51d906f37ab1949ff675
MD5 d7cf8b603aae4d614cbb193b93ade10a
BLAKE2b-256 ff9ab91a5e37582e411153e942e6792e61df8f56ae2f1a130e37bc0c35ab31d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d0c1c24d459c395336c0c74812a355ea2dd4bf2b12769e80b22c3c4732d7fe66
MD5 c0768474d23dbf239c70c22f771a8f5a
BLAKE2b-256 62f9e56e8290b2e878ceb428ff6057e21f86951dcc96acd4a40bc25ade0f9150

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ebb0feab6d0df3a7f31c7ac160d502922def09cd22bb074d695da6f8353a9367
MD5 75f103b4fa93a4c21845151d0923ad08
BLAKE2b-256 e96859792f2c40530e2860be459e009309ea6bcd58e10299a85d152d1b98168e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 49448fc91170dbe7c1def10629d15d39c12b5072d2ebd848bafa9ece74592533
MD5 18553d6c46ccad903c92f3447b33fd23
BLAKE2b-256 bec339c18a858d12ce9ce8c74c7c5d70d32454703f5d3c6dadd5fe62729f8467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solas_ai-0.5.0-cp37-cp37m-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 11436b9cf58ce61095e1e12b63749b0ff96264252e0353620e8c73d879b80b44
MD5 e2582b2698e0c79dc804e8ee5c79424b
BLAKE2b-256 318f5dff5ef170253fcc58ae2af9a7ddfb291ee0924bd21d17a0ef474d4f9a1c

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.0

19 files

0.5.1

11 files

This release

0.5.0 This release

10 files

0.4.4

15 files

0.4.3

15 files

0.4.2

15 files

0.3.10

12 files

0.3.8

11 files

0.2.4

11 files

0.2.3

11 files

0.2.2

11 files

0.2.1

12 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page