Created
September 3, 2017 19:35
-
-
Save jkarnows/b74fb93e9759a68c4cbae04ad2cf9724 to your computer and use it in GitHub Desktop.
Plotting a DET Curve
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
def DETCurve(fps,fns): | |
""" | |
Given false positive and false negative rates, produce a DET Curve. | |
The false positive rate is assumed to be increasing while the false | |
negative rate is assumed to be decreasing. | |
""" | |
axis_min = min(fps[0],fns[-1]) | |
fig,ax = plt.subplots() | |
plot(fps,fns) | |
yscale('log') | |
xscale('log') | |
ticks_to_use = [0.001,0.002,0.005,0.01,0.02,0.05,0.1,0.2,0.5,1,2,5,10,20,50] | |
ax.get_xaxis().set_major_formatter(matplotlib.ticker.ScalarFormatter()) | |
ax.get_yaxis().set_major_formatter(matplotlib.ticker.ScalarFormatter()) | |
ax.set_xticks(ticks_to_use) | |
ax.set_yticks(ticks_to_use) | |
axis([0.001,50,0.001,50]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment