I am attempting a classification task whereby the features used to describe classes are not all being used. For instance, Class A does not use feature 2, class B does not use feature 4, and class C does not use feature 1 and 2:
f1 | f2 | f3 | f4 | class
10 | NA | 23 | 30 | A
1 | 11 | 33 | NA | B
11 | NA | 20 | 32 | A
NA | NA | 55 | 50 | C
6 | 9 | 18 | NA | B
NA | NA | 49 | 45 | C
One way i have gone about approaching this problem, is converting all NA's to 0's. However, i believe that this would be incorrect. For instance, both class A and Class C both do not utilize feature 2, and if we assign all values to 0 in that feature space, we will be incorrectly attempting to distinguish between class A and class C, when there is nothing to distinguish in the first place. Imputing values for those features is not an option here.(ie., The data isnt missing per se, its just not possible for class A to have feature 2)
If i go ahead and input the dataset as is, with the NA values still inside, i end up with the following error when using a Naive Bayes classifier from the naivebayes package in R:
Error in density.default(x, na.rm = TRUE, ...): need at least 2 points to select a bandwidth automatically
How should i go about dealing with this problem correctly?