Mercurial > hg > camir-ismir2012
annotate toolboxes/FullBNT-1.0.7/netlab3.3/conffig.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 fh=conffig(y, t) |
Daniel@0 | 2 %CONFFIG Display a confusion matrix. |
Daniel@0 | 3 % |
Daniel@0 | 4 % Description |
Daniel@0 | 5 % CONFFIG(Y, T) displays the confusion matrix and classification |
Daniel@0 | 6 % performance for the predictions mat{y} compared with the targets T. |
Daniel@0 | 7 % The data is assumed to be in a 1-of-N encoding, unless there is just |
Daniel@0 | 8 % one column, when it is assumed to be a 2 class problem with a 0-1 |
Daniel@0 | 9 % encoding. Each row of Y and T corresponds to a single example. |
Daniel@0 | 10 % |
Daniel@0 | 11 % In the confusion matrix, the rows represent the true classes and the |
Daniel@0 | 12 % columns the predicted classes. |
Daniel@0 | 13 % |
Daniel@0 | 14 % FH = CONFFIG(Y, T) also returns the figure handle FH which can be |
Daniel@0 | 15 % used, for instance, to delete the figure when it is no longer needed. |
Daniel@0 | 16 % |
Daniel@0 | 17 % See also |
Daniel@0 | 18 % CONFMAT, DEMTRAIN |
Daniel@0 | 19 % |
Daniel@0 | 20 |
Daniel@0 | 21 % Copyright (c) Ian T Nabney (1996-2001) |
Daniel@0 | 22 |
Daniel@0 | 23 [C, rate] = confmat(y, t); |
Daniel@0 | 24 |
Daniel@0 | 25 fh = figure('Name', 'Confusion matrix', ... |
Daniel@0 | 26 'NumberTitle', 'off'); |
Daniel@0 | 27 |
Daniel@0 | 28 plotmat(C, 'k', 'k', 14); |
Daniel@0 | 29 title(['Classification rate: ' num2str(rate(1)) '%'], 'FontSize', 14); |