Learn R Programming

crimelinkage (version 0.0.4)

predict.naiveBayes: Generate prediction (sum of log bayes factors) from a naiveBayes object

Description

This does not include the log prior odds, so will be off by a constant.

Usage

"predict"(object, newdata, components = FALSE, vars = NULL, ...)

Arguments

object
a naive bayes object from naiveBayes
newdata
data frame of new predictors, column names must match NB names
components
(logical) return the log bayes factors from each component or return the sum of log bayes factors
vars
the names or column numbers of specific predictors. If NULL, then all predictors will be used
...
not currently used

Value

BF if components = FALSE, the sum of log bayes factors, if components = TRUE the component bayes factors (useful for plotting).It will give a warning, but still produce output if X is missing predictors. The output in this situation will be based on the predictors that are in X.

See Also

naiveBayes, plot.naiveBayes

Examples

Run this code
# See vignette: "Statistical Methods for Crime Series Linkage" for usage.

Run the code above in your browser using DataLab