Learn R Programming

crimelinkage (version 0.0.3)

predictNB: 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

predictNB(NB, X, components = FALSE, vars = NULL)

Arguments

NB
a naive bayes object from naiveBayes
X
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

Value

  • BF if components = FALSE, the sum of log bayes factors, if components = TRUE the component bayes factors (useful for plotting)

Examples

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

Run the code above in your browser using DataLab