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
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
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