机器学习可解释性工具箱XAI

2019 年 2 月 8 日 专知

【导读】XAI是Github上的一个机器学习可解释性工具箱。XAI包含多种分析和评价数据和模型的工具。XAI在开发时遵循负责的机器学习的8个原则。


XAI是Github上的一个机器学习可解释性工具箱,地址为:

https://github.com/EthicalML/xai

安装及一些简单的用例如下:


安装


pip install xai


简单用例


XAI可以识别数据不平衡。我们先载入census数据集:

import xai.data
df = xai.data.load_census()
df.head()

查看多列类别不平衡:

protected_cols = ["gender", "ethnicity", "age"]
ims = xai.show_imbalances(df, protected_cols)

查看一列类别不平衡:

im = xai.show_imbalance(df, "gender")

查看一列与另一列相交的不平衡:

im = xai.show_imbalance(df, "gender", cross=["loan"])

利用上采样或下采样进行平衡:

bal_df = xai.balance(df, "gender", cross=["loan"], upsample=1.0)

创建一个平衡的测试-训练划分:

# Balanced train-test split with minimum 300 examples of 
# the cross of the target y and the column gender
x_train, y_train, x_test, y_test = xai.balanced_train_test_split(
           x, y, cross=["gender"],
           
categorical_cols=categorical_cols, min_per_class=300)

# Visualise the imbalances of gender and the target
df_test = x_test.copy()
df_test["loan"] = y_test
_= xai.show_imbalance(df_test, "gender", cross=["loan"], categorical_cols=categorical_cols)


更多用例可以参考Github项目链接:

https://github.com/EthicalML/xai


-END-

专 · 知

专知《深度学习:算法到实战》课程全部完成!470+位同学在学习,现在报名,限时优惠!网易云课堂人工智能畅销榜首位!


请加专知小助手微信(扫一扫如下二维码添加),咨询《深度学习:算法到实战》参团限时优惠报名~

欢迎微信扫一扫加入专知人工智能知识星球群,获取专业知识教程视频资料和与专家交流咨询!

请PC登录www.zhuanzhi.ai或者点击阅读原文,注册登录专知,获取更多AI知识资料!

点击“阅读原文”,了解报名专知《深度学习:算法到实战》课程

登录查看更多
11

相关内容

《可解释的机器学习-interpretable-ml》238页pdf
专知会员服务
193+阅读 · 2020年2月24日
【新书】Pro 机器学习算法Python实现,379页pdf
专知会员服务
195+阅读 · 2020年2月11日
可解释AI(XAI)工具集—DrWhy
专知
25+阅读 · 2019年6月4日
【资源推荐】AI可解释性资源汇总
专知
47+阅读 · 2019年4月24日
医疗中的自动机器学习和可解释性
专知
24+阅读 · 2019年4月1日
可解释的机器学习
平均机器
25+阅读 · 2019年2月25日
On Feature Normalization and Data Augmentation
Arxiv
13+阅读 · 2020年2月25日
Arxiv
14+阅读 · 2020年1月27日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Arxiv
7+阅读 · 2018年1月31日
VIP会员
相关VIP内容
《可解释的机器学习-interpretable-ml》238页pdf
专知会员服务
193+阅读 · 2020年2月24日
【新书】Pro 机器学习算法Python实现,379页pdf
专知会员服务
195+阅读 · 2020年2月11日
相关资讯
可解释AI(XAI)工具集—DrWhy
专知
25+阅读 · 2019年6月4日
【资源推荐】AI可解释性资源汇总
专知
47+阅读 · 2019年4月24日
医疗中的自动机器学习和可解释性
专知
24+阅读 · 2019年4月1日
可解释的机器学习
平均机器
25+阅读 · 2019年2月25日
Top
微信扫码咨询专知VIP会员