predict.naiveBayes {crimelinkage}R Documentation

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

## 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

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

[Package crimelinkage version 0.0.4 Index]