nb2: nb2: Extended Naive Bayes - Updateable Version

Description Usage Arguments Value Author(s) See Also Examples

Description

Modified and extended copy of naiveBayes from e1071.

Usage

1
nb2(x, y, laplace = 0, discretize, discParams, ...)

Arguments

x

[matrix | data.frame]
A numeric matrix, or a data frame of categorical and/or numeric variables.

y

[numeric | factor | character]
Class vector.

laplace

[numeric(1)]
positive double controlling Laplace smoothing. The default (0) disables Laplace smoothing.

discretize

[character(1)]
If missing: No discretization will be performed and discParams argument is ignored. If "fixed": number of intervals or there boundaries have to be given in the discParam argument

discParams

[numeric | list]
If discretize = "fixed": Has to be a named list giving the boundaries for the variables to be discretized.

...

Currently ignored.

Value

[nb2]
additional element: "yc" contains Youngs-Cramer variance parameters

Author(s)

See Also

update.nb2, plot.nb2, print.nb2, predict.nb2

Examples

1
2
3
4
5
6
7
mod <- nb2(iris[, 1:4], iris[, 5])
mod

# Example for easy discretization:
discParam <- list(Sepal.L = c(5, 6, 7), Sepal.W = c(2.5, 3.5))
mod2 <- nb2(iris[, 1:4], iris[, 5], discretize = "fixed", discParams = discParam)
mod2

aschersleben/NBCD documentation built on May 12, 2019, 4:32 a.m.