confusion.matrix: Confusion matrix

Description Usage Arguments Details Value Examples

View source: R/confusion.matrix.R

Description

Returns a confusion matrix, based on a predicted and observed variable

Usage

1
confusion.matrix(predicted, observed)

Arguments

predicted

A factor variable of predicted mode

observed

A factor variable of observed mode

Details

The output rows are the predicted modes, the output columns are the observed

Value

A matrix of how predicted and observed modes correspond

Examples

1
2
3
4
5
6
7
8
9
pred<-numeric(10)+1
pred[5:6]<-2
pred<-factor(pred,labels=c("Mode1","Mode2"))

obs<-numeric(10)+1
obs[6:8]<-2
obs<-factor(obs,labels=c("Mode1","Mode2"))

confusion.matrix(pred,obs)

dprocter/modeid documentation built on May 19, 2019, 8:21 a.m.