Home   >   User Resources   >   Online Help   >   apaConfusionMatrix
 

 

Function index Version 3.0.0

apaConfusionMatrix(YObserved, YPredicted)

Excel=apaConfusionMatrix(YObserved, YPredicted)

Result

Returns the confusion matrix for observed and predicted class labels, with rows representing actual classes and columns representing predicted classes.

Syntax

YObserved: n x 1 vector of observed class labels (1..K)

YPredicted: n x 1 vector of predicted class labels (1..K)

Algorithm

Inputs are validated: non-empty column vectors with the same number of rows.

Compute the K×KK \times Kconfusion matrix where entry (i,j)\left( i,j \right)is the count of observations with actual class iiand predicted class jj.

Return a table with:

  • Header row: “Actual \ Pred” plus predicted class labels 1..K1..K.

  • Header column: actual class labels 1..K1..K.

  • Inner cells: confusion counts.