【发布时间】:2019-05-19 23:55:59
【问题描述】:
我有一个 arff 文件,我需要从中删除前 5 个属性(无需手动删除它们)。我尝试使用 Python-Weka-Wrapper3,正如 here 所解释的那样,它启用了 Weka 的过滤选项,但是在使用以下代码时出现错误:
import weka.filters as Filter
remove = Filter(classname="weka.filters.unsupervised.attribute.Remove", options=["-R", "1,2,3,4,5"])
我收到的错误如下:
Traceback (most recent call last):
File "/home/user/Desktop/file_loading.py", line 16, in <module>
removing = Filter(classname="weka.filters.unsupervised.attribute.Remove", options=["-R", "last"])
TypeError: 'module' object is not callable
此错误的原因可能是什么?如果有人知道使用 Python 从 arff 文件中删除属性的另一种方法,我将不胜感激。
【问题讨论】: