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 bernoulli_naive_bayes()
Multinomial Naive Bayes via multinomial_naive_bayes()
Poisson Naive Bayes via poisson_naive_bayes()
Gaussian Naive Bayes via gaussian_naive_bayes()
Non-Parametric Naive Bayes via nonparametric_naive_bayes()
Extended documentation can be found on the website:
Bug reports:
Suggestions:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.