Code covered by the BSD License  

Highlights from
Confusion Matrix


3.0 | 1 rating Rate this file 8 Downloads (last 30 days) File Size: 1.52 KB File ID: #28934

Confusion Matrix



Computes Confusion Matrix for Multiclass Problem

| Watch this File

File Information

Confusion Matrix give information on misclassification. How patterns have been classified in their actual classes against other classes for each class in a matrix form.

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
21 Oct 2010 Sa  
06 Oct 2010 Sean de

The author does not preallocate. This would be a faster engine (and there's probably a faster bsxfun solution)

L = length(c);
conf2 = zeros(L);
for ii = 1:L
Tii = T==ii;
S = sum(Tii);
for jj = 1:L
conf2(ii,jj) = sum ((Y==jj).*Tii)/S*100;

The help is wrong here:
"The vector RATE has two entries: the percentage of correct classifications and the total number of correct classifications."
RATE is actually returned as a scalar.

Contact us