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

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
2
3
## S3 method for class 'naiveBayes'
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

1
# See vignette: "Statistical Methods for Crime Series Linkage" for usage.

Example output



crimelinkage documentation built on May 2, 2019, 1:36 a.m.