qda
predict.qda(object, newdata, prior = object$prior, method = c("plug-in", "predictive", "debiased", "looCV"), ...)
"qda"
qda
object.
qda
.
"plug-in"
(the default) the usual unbiased parameter estimates are used and
assumed to be correct. With
"debiased"
an unbiased estimator of
the log posterior probabilities is used, and with
"predictive"
the
parameter estimates are integrated out using a vague prior. With
"looCV"
the leave-one-out cross-validation fits to the original
dataset are computed and returned.
This function is a method for the generic function
for class qda.
It can be invoked by calling
for an object x of the appropriate class, or directly by calling
regardless of the class of the object.
Missing values in
newdata
are handled by returning
NA
if the
quadratic discriminants cannot be evaluated. If
newdata
is omitted and
the
na.action
of the fit omitted cases, these will be omitted on the
prediction.
tr <- sample(1:50, 25) train <- rbind(iris[tr,,1], iris[tr,,2], iris[tr,,3]) test <- rbind(iris[-tr,,1], iris[-tr,,2], iris[-tr,,3]) cl <- factor(c(rep("s", 25), rep("c", 25), rep("v", 25))) zq <- qda(train, cl) predict(zq, test)$class