#NEWLINE# def plot_roc( auc_score , name , tpr , fpr , label = None ) : #NEWLINE# #INDENT# pylab . clf ( ) #NEWLINE# pylab . figure ( num = None , figsize = ( 5 , 4 ) ) #NEWLINE# pylab . grid ( True ) #NEWLINE# pylab . plot ( [ 0 , 1 ] , [ 0 , 1 ] , 'k--' ) #NEWLINE# pylab . plot ( fpr , tpr ) #NEWLINE# pylab . fill_between ( fpr , tpr , alpha = 0.5 ) #NEWLINE# pylab . xlim ( [ 0.0 , 1.0 ] ) #NEWLINE# pylab . ylim ( [ 0.0 , 1.0 ] ) #NEWLINE# pylab . xlabel ( 'False Positive Rate' ) #NEWLINE# pylab . ylabel ( 'True Positive Rate' ) #NEWLINE# pylab . title ( ( 'ROC curve (AUC = %0.2f) / %s' % ( auc_score , label ) ) , verticalalignment = 'bottom' ) #NEWLINE# pylab . legend ( loc = 'lower right' ) #NEWLINE# filename = name . replace ( ' ' , '_' ) #NEWLINE# pylab . savefig ( os . path . join ( CHART_DIR , ( ( 'roc_' + filename ) + '.png' ) ) , bbox_inches = 'tight' )