Naïve Bayes (Hand & Yu 2001) is a simple supervised machine learning algorithm, like k-nearest neighbors. A multivariate data set with a group column should be supplied, where one part (the training set) is assigned to groups, while the other part (the test set) has question marks in the group column. The rows in the test set are then assigned to groups (classification) according to their similarity with rows in the training set.
The Gaussian model is used for continuous data. For this model, all within-group variances for all variables must be non-zero. Therefore, a value is added to all zero-variances. This value is set to 0.1 times the variance of the given variable across all rows in the test and training sets. Classification is usually not very good when this rule is applied.
The multinomial model is used for count data. Laplacian smoothing is used.
The Bernoulli model is used for binary data, with smoothing.
The multinomial and Bernoulli models are implemented according to Manning et al. (2008).
The “flat prior” option assigns the same value to the prior for all group assignments, instead of being proportional to sample size.
Jackknifing cross-validation is implemented as for K-nearest neighbors.
Missing values supported by column average substitution.
References
Hand, D.J., Yu, K. 2001. Idiot’s Bayes – not so stupid after all? International Statistical Review 69:385–398.
Manning, C.D., Raghavan, P., Schütze, H. 2008. Introduction to Information Retrieval. Cambridge University Press.