confusion | R Documentation |
Compute the confusion matrix between two factors, or for an fda or mda object.
## Default S3 method:
confusion(object, true, ...)
## S3 method for class 'fda'
confusion(object, data, ...)
object |
the predicted factor, or an fda or mda model object. |
true |
the true factor. |
data |
a data frame (list) containing the test data. |
... |
further arguments to be passed to or from methods. |
This is a generic function.
For the default method essentially table(object, true)
, but
with some useful attribute(s).
fda
,
predict.fda
data(iris)
irisfit <- fda(Species ~ ., data = iris)
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.