logo
Loading...

Day88 f1-score of multi-class problem - Cupoy

專家好:在範例中,計算 f1_score的部份y_true = self.validation_da...

ml100-2-d88,ml100-2

Day88 f1-score of multi-class problem

2019/07/23 11:54 PM
機器學習新手論壇
Ray Xie
觀看數:0
回答數:1
收藏數:0
ml100-2-d88
ml100-2

專家好:


在範例中,計算 f1_score的部份


y_true = self.validation_data[1].argmax(axis = 1)
y_pred = self.model.predict(self.validation_data[0])
y_pred = (y_pred[:, 1] >= thres) * 1

logs["val_f1sc"] = f1_score(y_true = y_true, y_pred = y_pred, average="weighted")


在y_true裡面會有0-9的label, 但y_pred在做完處理後只有0-1的label

請問這樣計算f1_score是可以的嗎?

還是說應該要針對每個label算一個f1_score會比較好呢?


謝謝