使用 aif360 包缓解偏差时出错

error using aif360 package for bias mitigation

我正在修改 IBM AIF360 包以解决数据偏差问题。我在 google colab 中使用命令 !pip aif360 install 正确安装了包,但是几天后我在我的项目中工作,我收到了底部描述的错误,google colab 无法识别数据集我打电话来分析数据,为什么安装程序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)

这很简单。您所要做的就是从 link :

下载这两个文件

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',然后重新运行。它会像一个魅力:)。