aer: Apparent Error Rate

Description Usage Arguments Value Author(s) See Also Examples

View source: R/aer.R

Description

A function to calculate the apparent error rate of two classification vectors, i.e., the proportion of observed cases incorrectly predicted. It can be useful for evaluating discriminant analysis or other classification systems.

aer = \frac{1}{n} ∑_{i=1}^{n} I(y_i \neq \hat{y}_i)

Usage

1
aer(obs, predict)

Arguments

obs

a vector containing the observed classes.

predict

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

Value

The apparent error rate, a number between 0 (no agreement) and 1 (thorough agreement).

Author(s)

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

See Also

confusionmatrix, lda

Examples

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

# End (not run)

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