predict.fda | R Documentation |
Classify observations in conjunction with fda
.
## S3 method for class 'fda'
predict(object, newdata, type, prior, dimension, ...)
object |
an object of class |
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 |
... |
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 fda
. There should be a
predict
method for this object which is invoked. This method
should itself take as input object
and optionally newdata
.
fda
,
mars
,
bruto
,
polyreg
,
softmax
,
confusion
data(iris)
irisfit <- fda(Species ~ ., data = iris)
irisfit
## Call:
## fda(x = iris$x, g = iris$g)
##
## Dimension: 2
##
## Percent Between-Group Variance Explained:
## v1 v2
## 99.12 100
confusion(predict(irisfit, iris), iris$Species)
## Setosa Versicolor Virginica
## Setosa 50 0 0
## Versicolor 0 48 1
## Virginica 0 2 49
## attr(, "error"):
## [1] 0.02
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.