This is a specialized version of the Naive Bayes classifier, in which all features take on real values (numeric/integer) and class conditional probabilities are non-parametrically estimated with kernel density estimator. By default Gaussian kernel is used and the smoothing bandwidth is selected according to the Silverman's 'rule of thumb'. For more details, please see the references and the documentation of density
and bw.nrd0
.
The Non-Parametric Naive Bayes is available in both, naive_bayes()
and nonparametric_naive_bayes()
. This specialized implementation of the Naive Bayes does not provide a substantial speed-up over the general naive_bayes()
function but it should be more transparent and user friendly.
The nonparametric_naive_bayes
function is equivalent to naive_bayes()
when the numeric matrix or a data.frame contains only numeric variables and usekernel = TRUE
.
The missing values (NAs) are omitted during the parameter estimation. The NAs in the newdata in predict.nonparametric_naive_bayes()
are not included into the calculation of posterior probabilities; and if present an informative warning is given.