File Exchange

image thumbnail

Confusion Matrix

version 1.0 (1.52 KB) by

Computes Confusion Matrix for Multiclass Problem

3 Downloads

Updated

View License

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.

Comments and Ratings (2)

Sa

Sa (view profile)

Sean de

Sean de (view profile)

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;
   end
end

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.

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video