我正在修改IBM AIF360包,以解决数据中的偏见。我使用命令!pip aif360 installer正确地安装了软件包,但是在我的项目进行了几天之后,我得到了底部描述的错误,google不识别我调用的数据集来分析数据,为什么安装程序aif360包不能工作,请知道吗?
# 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)发布于 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‘并重新运行。它会像一种魅力:)。
https://stackoverflow.com/questions/62208023
复制相似问题