In this paper we show an efficient method for inducing classifiers that directly optimize the area under the ROC curve. Recently,AUC gained importance in the classification community as a mean to compare the performance of classifiers.
我就废话不多说了,大家还是直接看代码吧!
# 利用sklearn自建评价函数
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
from keras.callbacks import Callback
class RocAucEvaluation(Callback):
def __init__(self, validation_data=(), inte