首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用aif360包减少偏差的错误

使用aif360包减少偏差的错误
EN

Stack Overflow用户
提问于 2020-06-05 04:14:51
回答 1查看 906关注 0票数 0

我正在修改IBM AIF360包,以解决数据中的偏见。我使用命令!pip aif360 installer正确地安装了软件包,但是在我的项目进行了几天之后,我得到了底部描述的错误,google不识别我调用的数据集来分析数据,为什么安装程序aif360包不能工作,请知道吗?

代码语言:javascript
复制
# I am using AIF 360
dataset_orig = GermanDataset(protected_attribute_names=['age'],privileged_classes=[lambda x: x >= 25],features_to_drop=['personal_status', 'sex'] )   
dataset_orig_train, dataset_orig_test = dataset_orig.split([0.7], shuffle=True)
privileged_groups = [{'age': 1}]
unprivileged_groups = [{'age': 0}]
# Error I got
IOError: [Errno 2] File /usr/local/lib/python3.6/dist-packages/aif360/datasets/../data/raw/german/german.data does not exist: '/usr/local/lib/python3.6/dist-packages/aif360/datasets/../data/raw/german/german.data'

To use this class, please download the following files:

    https://archive.ics.uci.edu/ml/machine-learning-databases/statlog/german/german.data
    https://archive.ics.uci.edu/ml/machine-learning-databases/statlog/german/german.doc

and place them, as-is, in the folder:

    /usr/local/lib/python3.6/dist-packages/aif360/data/raw/german

An exception has occurred, use %tb to see the full traceback.

SystemExit: 1
/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py:2890: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-20 06:52:42

这很简单。您所要做的就是从链接下载这两个文件:

https://archive.ics.uci.edu/ml/machine-learning-databases/statlog/german/german.data https://archive.ics.uci.edu/ml/machine-learning-databases/statlog/german/german.doc

并将它们放入文件夹'/usr/local/lib/python3.6/dist-packages/aif360/data/raw/German‘并重新运行。它会像一种魅力:)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62208023

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档