This is a specialized version of the Naive Bayes classifier, in which all features take on real values and class conditional probabilities are modelled with the Gaussian distribution.
Class posterior probabilities are calculated using the Bayes' rule under the assumption of independence of predictors. If no newdata
is provided, the data from the object is used.
The Gaussian Naive Bayes is available in both, naive_bayes
and gaussian_naive_bayes
. The implementation of the specialized Naive Bayes provides more efficient performance though. The speedup comes from the restricting the data input to a numeric matrix and performing the linear algebra as well vectorized operations on it. In other words, the efficiency comes at cost of the flexibility.
The NAs in the newdata are not included into the calculation of posterior probabilities; and if present an informative warning is given.
The gaussian_naive_bayes
function is equivalent to the naive_bayes
function with the numeric matrix or a data.frame containing only numeric variables.