Mercurial > hg > emotion-detection-top-level
comparison Code/Classifiers/processKMeansResults.m @ 4:92ca03a8fa99 tip
Update to ICASSP 2013 benchmark
author | Dawn Black |
---|---|
date | Wed, 13 Feb 2013 11:02:39 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:e1cfa7765647 | 4:92ca03a8fa99 |
---|---|
1 | |
2 function [ groupStats, orderedGroups ] = processKMeansResults( ID, idx, ... | |
3 groupingCriteria, masterFileOutputID, titleName, DEBUG ) | |
4 | |
5 if( length( idx ) ~= length( groupingCriteria ) ) | |
6 disp('EEEK!'); | |
7 pause; | |
8 end | |
9 | |
10 groupIDs = ''; | |
11 groupStr = ''; | |
12 for( i = 1 : length( idx )) | |
13 % fprintf( fileOutputID, '%s \t %d \n', groupingCriteria(i), idx(i) ); | |
14 gID = [ groupingCriteria(i) num2str( idx(i) )]; | |
15 groupIDs = [ groupIDs ; gID ]; | |
16 groupStr = [ groupStr gID ]; | |
17 end | |
18 | |
19 % ------------- work out the confusion matrix ------------------------- | |
20 | |
21 groups = unique( groupIDs, 'rows' ); | |
22 noOfGroups = length( groups ); | |
23 orderedGroups = sort(cellstr(groups)); | |
24 groupStats = []; | |
25 for( i = 1 : noOfGroups ) | |
26 groupStats(i) = ((length( strfind( groupStr, char(orderedGroups(i)))))/length( idx ) ) * 100; | |
27 end | |
28 | |
29 if(DEBUG == 1) | |
30 figure(1); | |
31 bar( groupStats ); | |
32 set( gca, 'XTickLabel', orderedGroups ); | |
33 title([ titleName ' ' ID]); | |
34 end | |
35 end |