使用aif360包进行偏见缓解时出现错误

我在修改IBM的AIF360包以解决数据中的偏见问题。我在Google Colab中使用命令!pip install aif360正确安装了该包,但在项目进行几天后,我遇到了下述错误,Google Colab无法识别我用来分析数据的数据集,为什么aif360包的安装程序不起作用,请问有什么建议吗?

# 我正在使用AIF 360dataset_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}]# 我遇到的错误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.docand place them, as-is, in the folder:    /usr/local/lib/python3.6/dist-packages/aif360/data/raw/germanAn 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)

回答:

这很简单。你只需要从以下链接下载这两个文件:

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

然后将它们放入文件夹’/usr/local/lib/python3.6/dist-packages/aif360/data/raw/German’中,并重新运行程序。它会运作得非常好 :).

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注