confusion {mda}R Documentation

Confusion Matrices

Description

Compute the confusion matrix between two factors, or for an fda or mda object.

Usage

confusion(predict, true, ...)
confusion(object, data, ...)

Arguments

predict the predicted factor.
true the true factor.
object an fda or mda model object.
data a data frame (list) containing the test data.
... further arguments to be passed to or from methods.

Details

This is a generic function.

Value

For the default method essentially table(predict, true), but with some useful attribute(s).

See Also

fda, predict.fda

Examples

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