Mercurial > hg > camir-ismir2012
annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirclassify/display.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
rev | line source |
---|---|
Daniel@0 | 1 function display(c) |
Daniel@0 | 2 |
Daniel@0 | 3 % CLASSIFY/DISPLAY display of classification |
Daniel@0 | 4 |
Daniel@0 | 5 disp('Classification results:') |
Daniel@0 | 6 c.classes |
Daniel@0 | 7 |
Daniel@0 | 8 if isnan(c.correct) |
Daniel@0 | 9 disp('No label has been associated to the test set. Correct classification rate cannot be computed.'); |
Daniel@0 | 10 else |
Daniel@0 | 11 disp(['Correct classification rate: ',num2str(c.correct)]); |
Daniel@0 | 12 end |
Daniel@0 | 13 |
Daniel@0 | 14 %disp(['Number of observations: ',num2str(c.nbobs)]) |
Daniel@0 | 15 %disp(['Number of free parameters: ',num2str(c.nbparam)]) |
Daniel@0 | 16 |
Daniel@0 | 17 %disp('Posterior probability:') |
Daniel@0 | 18 %c.post{:} |
Daniel@0 | 19 |
Daniel@0 | 20 if 0 |
Daniel@0 | 21 figure |
Daniel@0 | 22 hold on |
Daniel@0 | 23 vt = c.training; |
Daniel@0 | 24 lt = c.labtraining; |
Daniel@0 | 25 va = c.test; |
Daniel@0 | 26 la = c.labtest; |
Daniel@0 | 27 for i = 1:size(vt,2) |
Daniel@0 | 28 scatter3(vt(1,i),vt(2,i),vt(3,i),'k+','SizeData',2); |
Daniel@0 | 29 text(vt(1,i),vt(2,i),vt(3,i),lt{i},'Color','k'); |
Daniel@0 | 30 end |
Daniel@0 | 31 for i = 1:size(va,2) |
Daniel@0 | 32 scatter3(va(1,:),va(2,:),va(3,:),'r+','SizeData',2); |
Daniel@0 | 33 text(va(1,i),va(2,i),va(3,i),la{i},'Color','r'); |
Daniel@0 | 34 end |
Daniel@0 | 35 xlabel('1') |
Daniel@0 | 36 ylabel('2') |
Daniel@0 | 37 zlabel('3') |
Daniel@0 | 38 rotate3d |
Daniel@0 | 39 end |