Commit 53edb31c authored by Manuel Günther's avatar Manuel Günther

Added missing test for roc_for_far function

parent 5a7ec24b
......@@ -172,7 +172,7 @@ def test_thresholding():
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'))
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment