コード例 #1
0
ファイル: approach.py プロジェクト: LeyliG/ds4se
 def Compute_precision_recall_gain(self):
     '''One might choose PRG if there is little interest in identifying false negatives '''
     prg_curve = prg.create_prg_curve(self.y_test, self.y_score)
     auprg = prg.calc_auprg(prg_curve)
     prg.plot_prg(prg_curve)
     logging.info('auprg:  %.3f' %  auprg)
     logging.info("compute_precision_recall_gain Complete")
     pass
コード例 #2
0
 def Compute_precision_recall_gain(self):
     '''One might choose PRG if there is little interest in identifying false negatives '''
     for count,sim in enumerate(self.sim_list):
         prg_curve = prg.create_prg_curve(self.y_test, self.y_score[count])
         auprg = prg.calc_auprg(prg_curve)
         prg.plot_prg(prg_curve)
         logging.info('auprg:  %.3f' %  auprg)
         logging.info("compute_precision_recall_gain Complete: "+str(sim))
     pass
コード例 #3
0
def do_prg(scores, true_labels, file_name='', directory='', plot=False):
    prg_curve = prg.create_prg_curve(true_labels, scores)
    auprg = prg.calc_auprg(prg_curve)
    if plot:
        prg.plot_prg(prg_curve)
        plt.title('Precision-Recall-Gain curve: AUC=%0.4f' % (auprg))
        plt.savefig(directory + file_name + "prg.png")

    return auprg