1
0
Fork 0

Select threshold

master
neingeist 10 years ago
parent 4bc9a2b246
commit 87457bb7b4

@ -23,17 +23,15 @@ for epsilon = min(pval):stepsize:max(pval)
% Note: You can use predictions = (pval < epsilon) to get a binary vector
% of 0's and 1's of the outlier predictions
predictions = (pval < epsilon);
tp = sum((predictions == 1) & (yval == 1));
fp = sum((predictions == 1) & (yval == 0));
fn = sum((predictions == 0) & (yval == 1));
prec = tp/(tp+fp);
rec = tp/(tp+fn);
F1 = (2*prec*rec)/(prec+rec);
% =============================================================