Professional Documents
Culture Documents
% plotting
plotConfMat(confmat, {'Dog', 'Cat', 'Horse'});
function plotConfMat(varargin)
%PLOTCONFMAT plots the confusion matrix with colorscale, absolute numbers
% and precision normalized percentages
%
% usage:
% PLOTCONFMAT(confmat) plots the confmat with integers 1 to n as class labels
% PLOTCONFMAT(confmat, labels) plots the confmat with the specified labels
%
% Vahe Tshitoyan
% 20/08/2017
%
% Arguments
% confmat: a square confusion matrix
% labels (optional): vector of class labels
% number of arguments
switch (nargin)
case 0
confmat = 1;
labels = {'1'};
case 1
confmat = varargin{1};
labels = 1:size(confmat, 1);
otherwise
confmat = varargin{1};
labels = varargin{2};
end