pipeline/evaluate.py
def plot_roc_curve(csvfile):
    """`csvfile` should be the csvfile of the evaluation statistics from the
    SENC parameter sweep.
    """
    df = pd.DataFrame.from_csv(csvfile)
    fig, ax = plt.subplots()
    frame = df[['fpr', 'r']].sort('fpr')
    ax.plot(frame['fpr'], frame['r'], color='black', alpha=0.85,
            linewidth=3)
    ax.set_title('ROC Curve')
    ax.set_ylabel('TPR')
    ax.set_xlabel('FPR')
    ax.set_ylim(0,1)

    # x values are FPR and y values are RECALL
    # metrics obtained from comparison on connected components ground truth
    cesna_x = 0.0040484809285604717
    cesna_y = 0.49224591663028472
    coda_x = 0.0032235301223333371
    coda_y = 0.41731067592697141
    edcar_x = 0.0013878215161439689
    edcar_y = 0.20758049657661148

    #ax.plot(cesna_x, cesna_y, color='r', alpha=0.8, marker='o', ms=10)
    ax.plot(cesna_x, cesna_y, color='black', marker='o', ms=10)
    plt.annotate('CESNA', xy=(cesna_x, cesna_y),
            ha='center', va='bottom', textcoords='offset points',
            xytext=(0, 3.5))

    #ax.plot(coda_x, coda_y, color='g', alpha=0.8, marker='o', ms=10)
    ax.plot(coda_x, coda_y, color='black', marker='o', ms=10)
    plt.annotate('CODA', xy=(coda_x, coda_y),
            ha='center', va='bottom', textcoords='offset points',
            xytext=(0, 3))

    #ax.plot(edcar_x, edcar_y, color=palette[0], alpha=0.8, marker='o', ms=10)
    ax.plot(edcar_x, edcar_y, color='black', marker='o', ms=10)
    plt.annotate('EDCAR', xy=(edcar_x, edcar_y),
            ha='center', va='bottom', textcoords='offset points',
            xytext=(0, 3.5))

    fig.savefig('roc-curve-with-competitor-points', bbox_inches='tight', dpi=300)
    fig.clear()
`csvfile` should be the csvfile of the evaluation statistics from the
    SENC parameter sweep.
    
`csvfile` should be the csvfile of the evaluation statistics from the
SENC parameter sweep.
` csvfile ` should be the csvfile of the evaluation statistics from the SENC parameter sweep .
def plot_roc_curve(csvfile):
    df = pd.DataFrame.from_csv(csvfile)
    fig, ax = plt.subplots()
    frame = df[['fpr', 'r']].sort('fpr')
    ax.plot(frame['fpr'], frame['r'], color='black', alpha=0.85,
            linewidth=3)
    ax.set_title('ROC Curve')
    ax.set_ylabel('TPR')
    ax.set_xlabel('FPR')
    ax.set_ylim(0,1)
    cesna_x = 0.0040484809285604717
    cesna_y = 0.49224591663028472
    coda_x = 0.0032235301223333371
    coda_y = 0.41731067592697141
    edcar_x = 0.0013878215161439689
    edcar_y = 0.20758049657661148
    ax.plot(cesna_x, cesna_y, color='black', marker='o', ms=10)
    plt.annotate('CESNA', xy=(cesna_x, cesna_y),
            ha='center', va='bottom', textcoords='offset points',
            xytext=(0, 3.5))
    ax.plot(coda_x, coda_y, color='black', marker='o', ms=10)
    plt.annotate('CODA', xy=(coda_x, coda_y),
            ha='center', va='bottom', textcoords='offset points',
            xytext=(0, 3))
    ax.plot(edcar_x, edcar_y, color='black', marker='o', ms=10)
    plt.annotate('EDCAR', xy=(edcar_x, edcar_y),
            ha='center', va='bottom', textcoords='offset points',
            xytext=(0, 3.5))
    fig.savefig('roc-curve-with-competitor-points', bbox_inches='tight', dpi=300)
    fig.clear()
def plot_roc_curve ( csvfile ) : df = pd . DataFrame . from_csv ( csvfile ) fig , ax = plt . subplots ( ) frame = df [ [ 'fpr' , 'r' ] ] . sort ( 'fpr' ) ax . plot ( frame [ 'fpr' ] , frame [ 'r' ] , color = 'black' , alpha = 0.85 , linewidth = 3 ) ax . set_title ( 'ROC Curve' ) ax . set_ylabel ( 'TPR' ) ax . set_xlabel ( 'FPR' ) ax . set_ylim ( 0 , 1 ) cesna_x = 0.0040484809285604717 cesna_y = 0.49224591663028472 coda_x = 0.0032235301223333371 coda_y = 0.41731067592697141 edcar_x = 0.0013878215161439689 edcar_y = 0.20758049657661148 ax . plot ( cesna_x , cesna_y , color = 'black' , marker = 'o' , ms = 10 ) plt . annotate ( 'CESNA' , xy = ( cesna_x , cesna_y ) , ha = 'center' , va = 'bottom' , textcoords = 'offset points' , xytext = ( 0 , 3.5 ) ) ax . plot ( coda_x , coda_y , color = 'black' , marker = 'o' , ms = 10 ) plt . annotate ( 'CODA' , xy = ( coda_x , coda_y ) , ha = 'center' , va = 'bottom' , textcoords = 'offset points' , xytext = ( 0 , 3 ) ) ax . plot ( edcar_x , edcar_y , color = 'black' , marker = 'o' , ms = 10 ) plt . annotate ( 'EDCAR' , xy = ( edcar_x , edcar_y ) , ha = 'center' , va = 'bottom' , textcoords = 'offset points' , xytext = ( 0 , 3.5 ) ) fig . savefig ( 'roc-curve-with-competitor-points' , bbox_inches = 'tight' , dpi = 300 ) fig . clear ( )
`csvfile` should be the csvfile of the evaluation statistics from the
SENC parameter sweep.
` csvfile ` should be the csvfile of the evaluation statistics from the SENC parameter sweep .
"""`csvfile` should be the csvfile of the evaluation statistics from the
    SENC parameter sweep.
    """ # x values are FPR and y values are RECALL # metrics obtained from comparison on connected components ground truth #ax.plot(cesna_x, cesna_y, color='r', alpha=0.8, marker='o', ms=10) #ax.plot(coda_x, coda_y, color='g', alpha=0.8, marker='o', ms=10) #ax.plot(edcar_x, edcar_y, color=palette[0], alpha=0.8, marker='o', ms=10)
csvfile