predict.mda | R Documentation |
Classify observations in conjunction with mda
.
## S3 method for class 'mda'
predict(object, newdata, type, prior, dimension, g, ...)
object |
a fitted mda object. |
newdata |
new data at which to make predictions. If missing, the training data is used. |
type |
kind of predictions: |
prior |
the prior probability vector for each class; the default is the training sample proportions. |
dimension |
the dimension of the space to be used, no larger
than the dimension component of |
g |
??? |
... |
further arguments to be passed to or from methods. |
An appropriate object depending on type
. object
has a
component fit
which is regression fit produced by the
method
argument to mda
. There should be a
predict
method for this object which is invoked. This method
should itself take as input object
and optionally newdata
.
mda
,
fda
,
mars
,
bruto
,
polyreg
,
softmax
,
confusion
data(glass)
samp <- sample(1:nrow(glass), 100)
glass.train <- glass[samp,]
glass.test <- glass[-samp,]
glass.mda <- mda(Type ~ ., data = glass.train)
predict(glass.mda, glass.test, type = "post") # abbreviations are allowed
confusion(glass.mda, glass.test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.