Visualizing NaïveBayes
Turn now to the NaïveBayes classifier. Its assumption that attributes are conditionally
independent given a particular class value means that the overall class probability
is obtained by simply multiplying the per-attribute conditional probabilities together
(and taking into account the class prior probabilities as well). In other words, with
two attributes, if you know the class probabilities along the x- and y-axes (and the
class prior), you can calculate the value for any point in space by multiplying them
together (and then normalizing). This is easy to understand if you visualize it as a
boundary plot.
Plot the predictions of NaïveBayes. But first discretize the attribute values. By
default, Weka’s NaiveBayes classifier assumes that the attributes are normally distributed
given the class. You should override this by setting useSupervisedDiscretization
to true using the Generic Object Editor window. This will cause NaïveBayes to
discretize the numeric attributes in the data with a supervised discretization technique.
In most practical applications of NaïveBayes, supervised discretization works
better than the default method. It also produces a more comprehensible visualization,
which is why we use it here.
Exercise 17.3.7. The plot that is generated by visualizing the predicted class
probabilities of NaïveBayes for each pixel location is quite different from
anything we have seen so far. Explain the patterns in it.