# -*- coding:utf-8 -*- from sklearn import metrics def recall_precision(true_y, pred_y): recall = metrics.recall_score(true_y, pred_y) precision = metrics.precision_score(true_y, pred_y) return recall, precision def auc_score(true_y, pred_score, label_value=1): f, t, _ = metrics.roc_curve(true_y, pred_score, pos_label=label_value) return metrics.auc(f, t)