Paper on ROC curve https://cours.etsmtl.ca/sys828/REFS/A1/Fawcett_PRL2006.pdf

ROC curve value is in unbalanced class sets or in unbalaned cost for positive/negative failurues


In [42]:
%matplotlib inline
from matplotlib import pylab as pl
pl.plot([0,1],label='random')
pl.plot(np.linspace(0,1.,10),[0,0.4,0.6,0.7,0.75,0.8,0.85,0.9,0.95,1],label='ROC curve')
pl.title('ROC curve')
pl.xlabel('$\\frac{FN}{TN+FP}$ = false positive rate = false alarm rate = 1-specificity')
pl.ylabel('$\\frac{TP}{TP+FN}$ = true positive rate = hit rate = recall = sensitivity')
pl.gca().set_aspect(1)
pl.gca().annotate('no positive', xy=(0, 0), xytext=(0.2, 0.1),
            arrowprops=dict(facecolor='black', shrink=0.01, width=1),
            )
pl.gca().annotate('all positive', xy=(1, 1), xytext=(0.8, 0.7),
            arrowprops=dict(facecolor='black', shrink=0.01, width=1),
            )
pl.legend(loc='upper left')
pl.gcf().set_size_inches(8.,8.)



In [ ]: