Description Usage Arguments Details Value See Also Examples
After binning, this adds pseudo counts to each bin count to give df approximate degrees of freedom. If partition=quantile, this does not assume a continuous uniform prior over support, but rather a discrete uniform over all (unlabeled) observations points.
1 2 3 4 5 | naiveBayes(formula, data, weights, df = 20, nbins = 30,
partition = c("quantile", "width"))
naiveBayes.fit(X, y, weights, df = 20, nbins = 30,
partition = c("quantile", "width"))
|
formula |
an object of class |
data |
data.frame of predictors, can include continuous and
categorical/factors along with a response vector (1 = linked, 0 = unlinked),
and (optionally) observation weights (e.g., |
weights |
a vector of observation weights or the column name in
|
df |
the degrees of freedom for each component density. if vector, each predictor can use a different df |
nbins |
the number of bins for continuous predictors |
partition |
for binning; indicates if breaks generated from quantiles or equal spacing |
X |
data frame of categorical and/or numeric variables |
y |
binary vector indicating linkage (1 = linked, 0 = unlinked) or logical vector (TRUE = linked, FALSE = unlinked) |
Fits a naive bayes model to continous and categorical/factor predictors. Continous predictors are first binned, then estimates shrunk towards zero.
BF a bayes factor object; list of component bayes factors
predict.naiveBayes
, plot.naiveBayes
1 | # See vignette: "Statistical Methods for Crime Series Linkage" for usage.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.