Skip to content

Commit

Permalink
Added missing test for roc_for_far function
Browse files Browse the repository at this point in the history
  • Loading branch information
siebenkopf committed Nov 24, 2015
1 parent 5a7ec24 commit 53edb31
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bob/measure/test_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def count(array, value=True):

def test_plots():

from . import eer_threshold, roc, precision_recall_curve, det, epc
from . import eer_threshold, roc, roc_for_far, precision_recall_curve, det, epc

# This test set is not separable.
positives = bob.io.base.load(F('nonsep-positives.hdf5'))
Expand All @@ -186,6 +186,14 @@ def test_plots():
xyref = bob.io.base.load(F('nonsep-roc.hdf5'))
assert numpy.array_equal(xy, xyref)

# This example will test the ROC for FAR plot calculation functionality.
far = [0.01, 0.1, 1]
ref = [0.48, 0.22, 0]
xy = roc_for_far(negatives, positives, far)
# uncomment the next line to save a reference value
assert numpy.array_equal(xy[0], far)
assert numpy.array_equal(xy[1], ref)

# This example will test the Precision-Recall plot calculation functionality.
xy = precision_recall_curve(negatives, positives, 100)
# uncomment the next line to save a reference value
Expand Down

0 comments on commit 53edb31

Please sign in to comment.