Select threshold
This commit is contained in:
parent
4bc9a2b246
commit
87457bb7b4
1 changed files with 44 additions and 46 deletions
|
@ -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);
|
||||
|
||||
% =============================================================
|
||||
|
||||
|
|
Reference in a new issue