📄 dd_error.m
字号:
function e = dd_error(w,x)
%DD_ERROR compute false positive and false negative for oc_classifier
%
% e = dd_error(w,x)
%
% Compute the fraction of target objects rejected and the fraction of outliers
% accepted:
% e(1) = target rejected
% e(2) = outlier accepted
% Copyright: D. Tax, R.P.W. Duin, davidt@ph.tn.tudelft.nl
% Faculty of Applied Physics, Delft University of Technology
% P.O. Box 5046, 2600 GA Delft, The Netherlands
[nin,llin] = renumlab(getlab(x));
if (size(llin,1)~=2)
error('DD_ERROR: both target and outlier examples are required');
end
lout = classd(w*x);
[nout,llout] = renumlab(lout);
e=[0 0];
difl = nin - nout; % where do the two labels disagree?
% what is the target class?
nr = strmatch('target ',llin); % should be 1 or 2 ...
if isempty(nr) % no match could be found, no space in the end?
nr = strmatch('target',llin);
end
if isempty(nr)
error('DD_ERROR: cannot find the target class');
end
% find the number of disagreements for target and outlier class:
e(nr) = length(find(difl==-1))/length(find(nin==1));
e(3-nr) = length(find(difl==1))/length(find(nin==2));
return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -