Neural Network Toolbox™ Previous page   Next Page 
confusion
 Provide feedback about this page

Classification confusion matrix

Syntax

Description

[c,cm,ind,per] = confusion(targets,outputs) takes these values:

targets
S x Q matrix, where each column vector contains a single 1 value, with all other elements 0. The index of the 1 indicates which of S categories that vector represents.
outputs
S x Q matrix, where each column contains values in the range [0.1]. The index of the largest element in the column indicates which of S categories that vector represents.

and returns these values:

c
Confusion value = fraction of samples misclassified
cm
S x S confusion matrix, where cm(i,j) is the number of samples whose target is the ith class that was classified as j
ind
S x S cell array, where ind{i,j} contains the indices of samples with the ith target class, but jth output class
per
S x 3 matrix, where each ith row represents the percentage of false negatives, false positives, and true positives for the ith category

[c,cm,ind,per] = confusion(TARGETS,OUTPUTS) takes these values:

targets
1 x Q vector of 1/0 values representing membership
outputs
S x Q matrix, of value in [0.1] interval, where values greater than or equal to 0.5 indicate class membership

and returns these values:

c
Confusion value = fraction of samples misclassified
cm
2 x 2 confusion matrix
ind
2 x 2 cell array, where ind{i,j} contains the indices of samples whose target is 1 versus 0, and whose output was greater than or equal to 0.5 versus less than 0.5
per
2 x 3 matrix where each ith row represents the percentage of false negatives, false positives, and true positives for the class and out-of-class

Examples

See Also

plotconfusion, roc


 Provide feedback about this page 

Previous page concur convwf Next page

 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS