⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dispconf.m

📁 一个关于数据聚类和模式识别的程序,在生物化学,化学中因该都可以用到.希望对大家有用,谢谢支持
💻 M
字号:
function confusion = dispconf(computed, desired, string)
%DISPCONF Display (and return) the confusion count matrix
%	CONFUSION = DISPCONF(COMPUTED, ACTUAL, STRING)
%	CONFUSION: confusion count matrix
%	COMPUTED: computed label
%	ACTUAL: actual label
%	STRING: string to be displayed below the confusion plot

%	Roger Jang, June-28-1997

if nargin < 3, string = ''; end
computed = computed(:);
desired = desired(:);

classLabel = countele(desired);
classNum = length(classLabel);
% compute the confusion count matrix
confusion = zeros(classNum);
for i = 1:classNum,
	for j = 1:classNum,
		confusion(i,j) = sum((desired==classLabel(i)).* ...
				(computed==classLabel(j)));
	end
end

colordef black;
figure('name', 'Confusion plots', 'numberTitle', 'off');

subplot(2,2,1);
pltmat(confusion, 'Confusion matrix', 'c', 10);

prob = confusion./(sum(confusion')'*ones(1, size(confusion,1)));
overall = sum(diag(confusion))/sum(sum(confusion));
new_prob = fix(prob*1000)/10;
new_overall = fix(overall*1000)/10;
subplot(2,2,2);
pltmat(new_prob, ['Overall recognition rate = ', num2str(new_overall), '%'], 'c', 9);
% Add the percentage sign
textH = findobj(gca, 'type', 'text');
for i=1:length(textH),
	str = get(textH(i), 'string');
	set(textH(i), 'string', [str, '%']);
end
xlabel(string)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -