Usage
naive.bayes(training, explanatory, data)
## S3 method for class 'bn.naive':
predict(object, data, prior, ..., prob = FALSE, debug = FALSE)tree.bayes(x, training, explanatory, whitelist = NULL, blacklist = NULL,
mi = NULL, root = NULL, debug = FALSE)
## S3 method for class 'bn.tan':
predict(object, data, prior, ..., prob = FALSE, debug = FALSE)
Arguments
training
a character string, the label of the training variable.
explanatory
a vector of character strings, the labels of the
explanatory variables.
object
an object of class bn.naive
, either fitted or not.
x, data
a data frame containing the variables in the model, which
must all be factors.
prior
a numeric vector, the prior distribution for the training
variable. It is automatically normalized if not already so.
whitelist
a data frame with two columns (optionally labeled
"from" and "to"), containing a set of arcs to be included in the
graph.
blacklist
a data frame with two columns (optionally labeled
"from" and "to"), containing a set of arcs not to be included in
the graph.
mi
a character string, the estimator used for the mutual
information coefficients for the Chow-Liu algorithm in TAN. Possible
values are mi
(discrete mutual information) and mi-g
(Gaussian mutual information).
root
a character string, the label of the explanatory variable to
bre used as the root of the tree in the TAN classifier.
...
extra arguments from the generic method (currently ignored).
prob
a boolean value. If TRUE
the posterior probabilities
used for prediction are attached to the predicted values as an attribute
called prob
.
debug
a boolean value. If TRUE
a lot of debugging output
is printed; otherwise the function is completely silent.