Skip to main content

Oracle Guardian AI Open Source Project

Project description

Oracle Guardian AI Open Source Project

PyPI Python Code style: black

Oracle Guardian AI Open Source Project is a library consisting of tools to assess fairness/bias and privacy of machine learning models and data sets. This package contains fairness and privacy_estimation modules.

The Fairness module offers tools to help you diagnose and understand the unintended bias present in your dataset and model so that you can make steps towards more inclusive and fair applications of machine learning.

The Privacy Estimation module helps estimate potential leakage of sensitive information in the training data through attacks on Machine Learning (ML) models. The main idea is to carry out Membership Inference Attacks on a given target model trained on a given sensitive dataset, and measure their success to estimate the risk of leakage.

Installation

You have various options when installing oracle-guardian-ai.

Installing the oracle-guardian-ai base package

python3 -m pip install oracle-guardian-ai

Installing extras libraries

The all-optional module will install all optional dependencies. Note the single quotes around installation of extra libraries.

python3 -m pip install 'oracle-guardian-ai[all-optional]'

To work with fairness/bias, install the fairness module. You can find extra dependencies in requirements-fairness.txt.

python3 -m pip install 'oracle-guardian-ai[fairness]'

To work with privacy estimation, install the privacy module. You can find extra dependencies in requirements-privacy.txt.

python3 -m pip install 'oracle-guardian-ai[privacy]'

Documentation

Examples

Measurement with a Fairness Metric

from guardian_ai.fairness.metrics import ModelStatisticalParityScorer
fairness_score = ModelStatisticalParityScorer(protected_attributes='<target_attribute>')

Bias Mitigation

from guardian_ai.fairness.bias_mitigation import ModelBiasMitigator
bias_mitigated_model = ModelBiasMitigator(
    model,
    protected_attribute_names='<target_attribute>',
    fairness_metric="statistical_parity",
    accuracy_metric="balanced_accuracy",
)

bias_mitigated_model.fit(X_val, y_val)
bias_mitigated_model.predict(X_test)

Contributing

This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide.

Find Getting Started instructions for developers in README-development.md.

Security

Consult the security guide SECURITY.md for our responsible security vulnerability disclosure process.

License

Copyright (c) 2023 Oracle and/or its affiliates. Licensed under the Universal Permissive License v1.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oracle_guardian_ai-1.3.0.tar.gz (60.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oracle_guardian_ai-1.3.0-py3-none-any.whl (85.3 kB view details)

Uploaded Python 3

File details

Details for the file oracle_guardian_ai-1.3.0.tar.gz.

File metadata

  • Download URL: oracle_guardian_ai-1.3.0.tar.gz
  • Upload date:
  • Size: 60.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for oracle_guardian_ai-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ae98543108432ec3242cb4e3b8170e48027d0d2455ed3441163412d8cd4fc231
MD5 1d91eb985b5c0b599a5727a3b50cfd50
BLAKE2b-256 ff4c5f05d88144eae3891391eef77d4d86affbfc29fcc1a998e13e6c7a69c292

See more details on using hashes here.

File details

Details for the file oracle_guardian_ai-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for oracle_guardian_ai-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a277c136773d0b57d85f56b1b11540938d3a26a3519fd4ab658a8aa609297553
MD5 9bcd92401ec41c36f47659a1fb5c0766
BLAKE2b-256 8d6950691ecef4c6da7036d53535601e51c8a97fd20b2b80d2709c89bda2367f

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