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