Replace missing values with mean (Weka)

孤街醉人 提交于 2019-12-13 02:44:31

问题


in Weka there is a filter called "ReplaceMissingValues" that permit to replace all missing values in a dataset using the mean of each attribute. I'd like to replace missing values, for a certain attribute, using the mean of values that belong to a certain class. For example in a binary dataset I think that is more correct to replace a missing value for an attribute in record that belong to the positive class using the mean calculated with only the records that belong to the positive class. So how is possible to realized it? How can we replace values only for record that belong to a certain class?


回答1:


If you want to replace missing values of Class A by taking the mean calculated from the training instances of that particular class A, then you are "bias"ing your dataset. To avoid bias (which eventually will overfit your trained model), it is wise to use the default "replace missing values" function- i.e., to consider mean and mode of all training instances rather than of just that particular class.



来源:https://stackoverflow.com/questions/10269884/replace-missing-values-with-mean-weka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!