数据挖掘——Weka之利用过滤器(filter)删除缺省值

        这里我采用的是一个叫trans_transformed.data的数据集( Download "trains-transformed.data" from https://archive.ics.uci.edu/ml/datasets/Trains),通过python修改部分格式并转换成了.arff(数据集内容如下),里面的data有很多缺省值,如何通过Veka用filter删除其中的缺省值呢?

  1. 用veka Open file打开你需要的.arff文件。
  2. 选择filter中unsupervised->instance->RemoveWithValues,然后在filter下面的对话框中成功显示了RemoveWithValues。
  3. 单击对话框,弹出如下界面,在attributeIndex中输入你想要删除缺省值的Attribute序号,将invertSelection改为True(为反选),matchMissingValues改为True(匹配缺省值),最后在nominalIndices中写上你的属性值的序号(该属性只有一个属性值,序号为1,因为选了反选,所以不删除有该属性值的example),OK。
  4. Apply. 从原来的10组examples,删除了带有缺省值的Examples7个,剩下三个具有完整Attributes的examples
  5. 因为该实验我选择了一个具有最多缺省的属性来删除,所以不需要再删除其他Attribute的缺省值,如果需要多个filter,可以选择filter里的mutifilter,同时配置多个filter的值。

猜你喜欢

转载自blog.csdn.net/m0_45338067/article/details/107214283