confusionmatrix: Confusion Matrix

Description Usage Arguments Value Author(s) See Also Examples

View source: R/confusionmatrix.R

Description

A function to compute the confusion matrix of two classification vectors. It can be useful for evaluating discriminant analysis or other classification systems.

Usage

1

Arguments

obs

a vector containing the observed classes.

predict

a vector with the same length of obs containing the predicted classes.

Value

A square matrix containing the number of objects in each class, observed (rows) and predicted (columns). Diagonal elements refers to agreement of obs and predict.

Author(s)

Anderson Rodrigo da Silva <anderson.agro@hotmail.com>

See Also

aer, lda

Examples

1
2
3
4
5
6
data(iris)
da <- lda(Species ~ ., data = iris)
pred <- predict(da, dimen = 1)
confusionmatrix(iris$Species, pred$class)

# End (not run)

biotools documentation built on Aug. 7, 2021, 9:06 a.m.