- train
a matrix or data frame with predictors.
- ...
further arguments passed to MASS::qda()
or its predict()
method (see the corresponding help page).
- formula
a formula with left term being the factor variable to predict
and the right term with the list of independent, predictive variables,
separated with a plus sign. If the data frame provided contains only the
dependent and independent variables, one can use the class ~ .
short
version (that one is strongly encouraged). Variables with minus sign are
eliminated. Calculations on variables are possible according to usual
formula convention (possibly protected by using I()
).
- data
a data.frame to use as a training set.
- subset
index vector with the cases to define the training set in use
(this argument must be named, if provided).
- na.action
function to specify the action to be taken if NA
s are
found. For ml_qda()
na.fail
is used by default. The calculation is
stopped if there is any NA
in the data. Another option is na.omit
,
where cases with missing values on any required variable are dropped (this
argument must be named, if provided). For the predict()
method, the
default, and most suitable option, is na.exclude
. In that case, rows with
NA
s in newdata=
are excluded from prediction, but reinjected in the
final results so that the number of items is still the same (and in the
same order as newdata=
).
- response
a vector of factor for the classification.
- object
an mlQda object
- newdata
a new dataset with same conformation as the training set (same
variables, except may by the class for classification or dependent variable
for regression). Usually a test set, or a new dataset to be predicted.
- type
the type of prediction to return. "class"
by default, the
predicted classes. Other options are "membership"
the membership (a
number between 0 and 1) to the different classes, or "both"
to return
classes and memberships.
- prior
the prior probabilities of class membership. By default, the
prior are obtained from the object and, if they where not changed,
correspond to the proportions observed in the training set.
- method
"plug-in"
, "predictive"
, "debiased"
, "looCV"
, or
"cv"
. "plug-in"
(default) the usual unbiased parameter estimates are
used. With "predictive"
, the parameters are integrated out using a vague
prior. With "debiased"
, an unbiased estimator of the log posterior
probabilities is used. With "looCV"
, the leave-one-out cross-validation
fits to the original data set are computed and returned. With "cv"
,
cross-validation is used instead. If you specify method = "cv"
then
cvpredict()
is used and you cannot provide newdata=
in that case.