?? evalf.m
字號:
% function m = evalf(trueclass,cl,x,sfct)
%
% DESCRIPTION
% computes f1 measure
% ignores x and sfct - just for compatibility
%
% Copyright (c) 1998-2002 by Alexander Strehl
function m = evalf(trueclass,cl,x,sfct)
remappedcl = zeros(size(cl));
A = zeros(max(cl),2+max(trueclass));
for i=1:max(cl),
activepoints = find(cl==i);
composition = hist(trueclass(activepoints),1:max(trueclass));
j = find(composition==max(composition));
j = j(1);
A(i,:) = [j i composition];
end;
A = sortrows(A);
A = A(:,3:size(A,2));
nha = sum(A,1);
nell = sum(A,2);
nhamatrix = ones(length(nell),1) * nha;
nellmatrix = nell * ones(1,length(nha));
fmatrix = (2*A) ./ (nhamatrix+nellmatrix);
m = sum(max(fmatrix,[],1) .* nha) / length(trueclass);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -