next up previous contents index
Next: Area under the ROC Up: Error computation Previous: Basic errors   Contents   Index

Precision and recall

In the literature, two other measures are often used, namely

: defined as

$\displaystyle \textrm{precision} = \frac{\textrm{\char93  of correct target predictions}} {\textrm{\char93  of target predictions}},$    

: is basically the true positive rate

$\displaystyle \textrm{recall} = \frac{\textrm{\char93  of correct target predictions}} {\textrm{\char93  of target examples}}.$    

These errors are returned in the second output variable of dd_error:
  >> [e,f] = dd_error(z,w)
Here f(1) contains the precision, and f(2) the recall.

Finally, a derived performance criterion using the precision and recall is the $ F1$ measure, defined as:

$\displaystyle F_1 = \frac{2\cdot\textrm{precision}\cdot\textrm{recall}} {\textrm{precision} + \textrm{recall}}.$    

This can be computed using dd_f1:
  >> x = target_class(gendatb([50 0]),'1');
  >> w = svdd(x,0.1);
  >> z = oc_set(gendatb(200),'1');
  >> dd_f1(x,w)
  >> dd_f1(x*w)
  >> x*w*dd_f1

David M.J. Tax 2006-07-26