Daniel@0: function fh=conffig(y, t) Daniel@0: %CONFFIG Display a confusion matrix. Daniel@0: % Daniel@0: % Description Daniel@0: % CONFFIG(Y, T) displays the confusion matrix and classification Daniel@0: % performance for the predictions mat{y} compared with the targets T. Daniel@0: % The data is assumed to be in a 1-of-N encoding, unless there is just Daniel@0: % one column, when it is assumed to be a 2 class problem with a 0-1 Daniel@0: % encoding. Each row of Y and T corresponds to a single example. Daniel@0: % Daniel@0: % In the confusion matrix, the rows represent the true classes and the Daniel@0: % columns the predicted classes. Daniel@0: % Daniel@0: % FH = CONFFIG(Y, T) also returns the figure handle FH which can be Daniel@0: % used, for instance, to delete the figure when it is no longer needed. Daniel@0: % Daniel@0: % See also Daniel@0: % CONFMAT, DEMTRAIN Daniel@0: % Daniel@0: Daniel@0: % Copyright (c) Ian T Nabney (1996-2001) Daniel@0: Daniel@0: [C, rate] = confmat(y, t); Daniel@0: Daniel@0: fh = figure('Name', 'Confusion matrix', ... Daniel@0: 'NumberTitle', 'off'); Daniel@0: Daniel@0: plotmat(C, 'k', 'k', 14); Daniel@0: title(['Classification rate: ' num2str(rate(1)) '%'], 'FontSize', 14);