2020
10-08
10-08
在keras里面实现计算f1-score的代码
我就废话不多说了,大家还是直接看代码吧!###以下链接里面的codeimportnumpyasnpfromkeras.callbacksimportCallbackfromsklearn.metricsimportconfusion_matrix,f1_score,precision_score,recall_scoreclassMetrics(Callback):defon_train_begin(self,logs={}):self.val_f1s=[]self.val_recalls=[]self.val_precisions=[]defon_epoch_end(self,epoch,logs={}):val_predict=(np.asarray(self.model...
继续阅读 >