The naivebayes package provides an efficient implementation of the popular Naive Bayes classifier in R. It was developed and is now maintained based on three principles: it should be efficient, user friendly and written in Base R. The last implies no dependencies, however, it neither denies nor interferes with being efficient as many functions from the Base R distribution use highly efficient routines programmed in lower level languages, such as C or FORTRAN. In fact, the naivebayes package utilizes only such functions for resource-intensive calculations.
The general function
naive_bayes() detects the class of each feature in the dataset and, depending on the user choices, assumes possibly different distribution for each feature. It currently supports following class conditional distributions:
categorical distribution for discrete features
Poisson distribution for non-negative integers
Gaussian distribution for continuous features
non-parametrically estimated densities via Kernel Density Estimation for continuous features
In addition to that specialized functions are available which implement:
Bernoulli Naive Bayes via
Multinomial Naive Bayes via
Poisson Naive Bayes via
Gaussian Naive Bayes via
Non-Parametric Naive Bayes via
Extended documentation can be found on the website:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.