| Neural Network Toolbox |
|
confusion
| | Provide feedback about this page |
Classification confusion matrix
Syntax
[c,cm,ind,per] = confusion(targets,outputs)
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
load simpleclass_dataset
net = newpr(simpleclassInputs,simpleclassTargets,20);
net = train(net,simpleclassInputs,simpleclassTargets);
simpleclassOutputs = sim(net,simpleclassInputs);
[c,cm,ind,per] =
confusion(simpleclassTargets,simpleclassOutputs)
See Also
plotconfusion, roc
| | Provide feedback about this page |
 | concur | | convwf |  |