实现过程
from keras import backend as K
def Precision(y_true, y_pred):
"""精确率"""
tp= K.sum(K.round(K.clip(y_true * y_pred, 0, 1))) # true positives
pp= K.sum(K.round(K.clip(y_pred, 0, 1))) # predicted positives
precision = tp/ (pp+ K.epsilon())
return precision
def Recall(y_true, y_pred):
"""召回率"
2021-11-26 15:44:50
125KB
al
ALL
AS
1