simpleprc.m

来自「ddtool,实现one class classification.包括gaus」· M 代码 · 共 44 行

M
44
字号
function [f,thr] = simpleprc(netout,truelab)% Check the size of the netout vectorif size(netout,2)~=1	netout = netout';	if size(netout,2)~=1		error('Please make netout a column vector.');	endend% Collect all sizes:n = size(netout,1);n_t = sum(truelab);% Sort the netout:[sout,I] = sort(-netout);% and therefore also reorder the true labels accordinglyslab = truelab(I);% I am not bothered by identical objects now... but it should be here% slab   1110011101 0001001000000%    + <-----------+-------------%TP=     111  111 1%FP=        11   1%FN=                   1  1%% precision = TP/(TP+FP)% recall =    TP/(TP+FN)f = cumsum(slab);normprec = (1:n)';prec = f./normprec;rec = f/n_t;f = [prec rec];% On request, also the thresholds are returned:if nargout>1	thr = sout;endreturn

⌨️ 快捷键说明

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