主要介绍了使用keras实现Precise, Recall, F1-socre方式,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
2022-02-26 19:38:20 120KB keras Precise Recall F1-socre
1
实现过程 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