confusion {mda} | R Documentation |
Compute the confusion matrix between two factors, or for an fda or mda object.
confusion(predict, true)
predict |
the predicted factor, or an fda or mda model |
true |
the true factor, or else (in the case where predict is a model object) a data frame (list) containing the test data. |
Essentially table(predict, true)
, but with some useful
attribute(s).
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