Prediction with some naive Bayes classifiers {Rfast2} | R Documentation |
Prediction with some naive Bayes classifiers
Description
Prediction with some naive Bayes classifiers.
Usage
weibullnb.pred(xnew, shape, scale, ni)
normlognb.pred(xnew, expmu, sigma, ni)
laplacenb.pred(xnew, location, scale, ni)
logitnormnb.pred(xnew, m, s, ni)
betanb.pred(xnew, a, b, ni)
cauchynb.pred(xnew, location, scale, ni)
Arguments
xnew |
A numerical matrix with new predictor variables whose group is to be predicted. For the Gaussian naive Bayes, this is set to NUUL, as you might want just the model and not to predict the membership of new observations. For the Gaussian case this contains positive numbers (greater than or equal to zero), but for the multinomial and Poisson cases, the matrix must contain integer valued numbers only. For the logistic normal (logitnormnb.pred) the data must be percentages strictly between 0 and 1. |
shape |
A matrix with the group shape parameters. Each row corresponds to a group. |
scale |
A matrix with the group scale parameters of the Laplace or the Cauchy distribution. Each row corresponds to a group. |
expmu |
A matrix with the group mean parameters. Each row corresponds to a group. |
m |
A matrix with the group mean parameters. Each row corresponds to a group. |
sigma |
A matrix with the group (MLE, hence biased) variance parameters. Each row corresponds to a group. |
s |
A matrix with the group MLE variance parameters. Each row corresponds to a group. |
location |
A matrix with the group location parameters of the Laplace or of the Cauchy distribution. Each row corresponds to a group. |
a |
A matrix with the group "alpha" parameters of the beta distribution. Each row corresponds to a group. |
b |
A matrix with the group "beta" parameters of the beta distribution. Each row corresponds to a group. |
ni |
A vector with the frequencies of each group. |
Value
A numerical vector with 1, 2, ... denoting the predicted group.
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
See Also
Examples
x <- matrix( rweibull( 100, 3, 4 ), ncol = 2 )
ina <- rbinom(50, 1, 0.5) + 1
a <- weibull.nb(x, x, ina)
est <- weibullnb.pred(x, a$shape, a$scale, a$ni)
table(ina, est)