This is a classification technique based on Bayes theorem with an assumption of independence among predictors. In layman's terms, a naive Bayes classifier assumes that the presence of a particular feature in a class is unrelated to the presence of any other feature. First, let's look at the HouseVotes84 dataset:
> library(mlbench)> data(HouseVotes84)> head(HouseVotes84)
The output is shown in the following screenshot:
The first variable, Class, is a binary one: republican or democrat. In addition, we have 16 traits associated with each individual. The following program calls the naiveBayes() function which computes the conditional ...