删除 Weka 中的缺失值 [英] Remove Missing Values in Weka
问题描述
我正在使用 Weka 中的数据集进行包含缺失值的分类.据我了解,当使用像 NaiveBayes 这样的分类器时,Weka 会自动将它们替换为训练数据的众数或均值(使用过滤器 unsupervised/attribute/ReplaceMissingValues
).
I'm using a dataset in Weka for classfication that includes missing values. As far as I understood, Weka replaces them automatically with the Modes or Mean of the training data (using the filter unsupervised/attribute/ReplaceMissingValues
) when using a classifier like NaiveBayes.
我想尝试删除它们,看看这如何影响分类器的质量.有过滤器可以做到这一点吗?
I would like to try removing them, to see how this effects the quality of the classifier. Is there a filter to do that?
推荐答案
请参阅下面的这个答案以获得更好的、现代的方法.
See this answer below for a better, modern approach.
我的方法并不完美,因为如果您有超过 5 或 6 个属性,那么应用就会变得非常麻烦,但如果只有少数属性缺少值,我建议应将 MultiFilter 用于此目的.
My approach is not the perfect one because IF you have more than 5 or 6 attributes then it becomes quite cumbersome to apply but I can suggest that MultiFilter should be used for this purpose if only a few attributes have missing values.
如果您在 2 个属性中缺少值,那么您将在 MultiFilter 中使用 RemoveWithValues 2 次.
If you have missing values in 2 attributes then you'll use RemoveWithValues 2 times in a MultiFilter.
- 在 Weka Explorer 中加载您的数据
- 从过滤器区域选择多重过滤器
- 点击 MultiFilter 并添加 RemoveWithValues
- 然后使用属性索引配置每个 RemoveWithValues 过滤器并在 matchMissingValues 中选择 True
- 保存过滤器设置,然后在资源管理器中点击应用.
这篇关于删除 Weka 中的缺失值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!