next up previous contents
Next: k-Nearest Neighbor Classifier Up: Classificaiton of Sets Previous: mb_mlpsets.m

mb_mlpsetsummary.m

 function [confusion, confusion_nounk, Pc]=mb_mlpsetsummary(setinfo)
% MB_MLPSETSUMMARY - Summarize the output from MB_MLPCONFMAT
%
% M. Boland - 14 Apr 1999

% $Id: mb_mlpsetsummary.m_tmp,v 1.1 1999/06/26 14:16:36 boland Exp $

if(~iscell(setinfo))
  error('SETINFO must be a cell array in which each element 
	contains the output from mb_mlptrainstoptestsets') ;
end

if(length(setinfo)<1)
  error('SETINFO has no elements') ;
end

confusion = zeros(size(setinfo{1})) ;
confusion_nounk = zeros(size(setinfo{1},1), size(setinfo{1},2)-1) ;
pc_all = [] ;
pc_nounk_all = [] ;

for i=1:length(setinfo)
  cmat = setinfo{i} ./ (sum(setinfo{i}')' * ones(1,size(setinfo{i},2))) ;
  confusion = confusion + setinfo{i} ; 
  pc_all = [pc_all mean(diag(cmat))] ; 

  nounk = setinfo{i}(:,1:(end-1)) ;
  confusion_nounk = confusion_nounk + nounk ;
  cmat_nounk = nounk ./ ((sum(nounk')'+realmin) * ones(1,size(nounk,2))) ;
  pc_nounk_all = [pc_nounk_all mean(diag(cmat_nounk))] ;
end

confusion = confusion ./ (sum(confusion')' * ones(1,size(confusion,2))) ;
confusion_nounk = confusion_nounk ./ (sum(confusion_nounk')' * ...
                   ones(1,size(confusion_nounk,2))) ;

Pc = [mean(pc_all) var(pc_all) ; mean(pc_nounk_all) var(pc_nounk_all)] ;



 



Copyright ©1999 Michael V. Boland
1999-09-18