annotate toolboxes/FullBNT-1.0.7/netlab3.3/conffig.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function fh=conffig(y, t)
wolffd@0 2 %CONFFIG Display a confusion matrix.
wolffd@0 3 %
wolffd@0 4 % Description
wolffd@0 5 % CONFFIG(Y, T) displays the confusion matrix and classification
wolffd@0 6 % performance for the predictions mat{y} compared with the targets T.
wolffd@0 7 % The data is assumed to be in a 1-of-N encoding, unless there is just
wolffd@0 8 % one column, when it is assumed to be a 2 class problem with a 0-1
wolffd@0 9 % encoding. Each row of Y and T corresponds to a single example.
wolffd@0 10 %
wolffd@0 11 % In the confusion matrix, the rows represent the true classes and the
wolffd@0 12 % columns the predicted classes.
wolffd@0 13 %
wolffd@0 14 % FH = CONFFIG(Y, T) also returns the figure handle FH which can be
wolffd@0 15 % used, for instance, to delete the figure when it is no longer needed.
wolffd@0 16 %
wolffd@0 17 % See also
wolffd@0 18 % CONFMAT, DEMTRAIN
wolffd@0 19 %
wolffd@0 20
wolffd@0 21 % Copyright (c) Ian T Nabney (1996-2001)
wolffd@0 22
wolffd@0 23 [C, rate] = confmat(y, t);
wolffd@0 24
wolffd@0 25 fh = figure('Name', 'Confusion matrix', ...
wolffd@0 26 'NumberTitle', 'off');
wolffd@0 27
wolffd@0 28 plotmat(C, 'k', 'k', 14);
wolffd@0 29 title(['Classification rate: ' num2str(rate(1)) '%'], 'FontSize', 14);