Oracle Guardian AI 的公平性评估与隐私风险估计工具

Oracle 开源的 Guardian AI 库包含 fairness 与 privacy_estimation 两个模块,分别用于诊断数据集和模型中的偏见,以及通过成员推断攻击估计训练数据敏感信息泄露风险。

# Oracle 守护者 AI 开源项目 [![PyPI](https://img.shields.io/pypi/v/oracle-guardian-ai.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/oracle-guardian-ai/) [![Python 键](https://img.shields.io/pypi/pyversions/oracle-guardian-ai.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/oracle-guardian-ai/) [![代码样式:黑色](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://github.com/ambv/black) Oracle Guardian AI Open Source Project是一个由评估机器学习模型和数据集的公正性/偏见和隐私的工具组成的库。 `fairness` 财务报告和财务报告 `privacy_estimation` 模块。 那个... `Fairness` 模块提供了帮助您诊断和理解数据集和模型中意外存在的偏差的工具,以便您能够采取步骤,实现机器学习的更加包容和公平的应用。 那个... `Privacy Estimation` 模块有助于通过攻击机器学习模型(ML)来估计培训数据中敏感信息可能泄露的情况。主要的想法是对特定敏感数据集所训练的目标模型进行会员推论攻击,并衡量其成功与否,以估计泄漏风险。 ## 安装 您安装时有各种选项 `oracle-guardian-ai`. ### 安装 oracle-guardian-ai 基包 ```bash python3 -m pip install oracle-guardian-ai ``` ### 安装额外库 那个... `all-optional` 模块将安装所有可选的依赖性。注意安装额外库周围的单引号。 ```bash python3 -m pip install 'oracle-guardian-ai[all-optional]' ``` 为了公平/平衡地开展工作,安装 `fairness` 模块。您可以在 [要求-公平性.txt](https://github.com/oracle/guardian-ai/blob/main/guardian_ai/requirements-fairness.txt). ```bash python3 -m pip install 'oracle-guardian-ai[fairness]' ``` 为了进行隐私估算,安装 `privacy` 模块。您可以在 [需求 -- -- 隐私.txt](https://github.com/oracle/guardian-ai/blob/main/guardian_ai/requirements-privacy.txt). ```bash python3 -m pip install 'oracle-guardian-ai[privacy]' ``` ## 文档 - [Oracle 守护者 AI 文档](https://oracle-guardian-ai.readthedocs.io/en/latest/index.html) - [OCI 数据科学和 AI 服务](https://github.com/oracle/oci-data-science-ai-samples) - [Oracle AI & 数据科学博客](https://blogs.oracle.com/ai-and-datascience/) ## 实例 ### 使用公平度量衡 ```python from guardian_ai.fairness.metrics import ModelStatisticalParityScorer fairness_score = ModelStatisticalParityScorer(protected_attributes='<target_attribute>') ``` ### 减少偏见 ```python 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) ``` ## 捐款 该项目欢迎社区的贡献。在提交拉动请求之前,请审查我们 [捐款指南](<https://github.com/oracle/guardian-ai/blob/main/CONTRIBUTING.md>). 查找开发者的启动指令 [README - 开发.md](https://github.com/oracle/guardian-ai/blob/main/README-development.md). ## 警卫 咨询安全指南 [SECURITY . md (英语).](https://github.com/oracle/guardian-ai/blob/main/SECURITY.md) 我们负责的安全弱点披露程序。 ## 许可证 版权 (c) 2023甲骨文和/或其附属公司。 [通用许可 v1.0](https://oss.oracle.com/licenses/upl/).

查看原始来源