Change f1 score to single value
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -305,7 +305,8 @@ def get_f1_score(cumulative_precisions: List[np.ndarray],
|
|||||||
if not np.count_nonzero(cumulative_precision + cumulative_recall):
|
if not np.count_nonzero(cumulative_precision + cumulative_recall):
|
||||||
cumulative_f1_scores.append([])
|
cumulative_f1_scores.append([])
|
||||||
continue
|
continue
|
||||||
f1_score = 2 * ((cumulative_precision * cumulative_recall) / (cumulative_precision + cumulative_recall + 0.001))
|
f1_score = 2 * ((cumulative_precision[-1] * cumulative_recall[-1]) /
|
||||||
|
(cumulative_precision[-1] + cumulative_recall[-1] + 0.001))
|
||||||
cumulative_f1_scores.append(f1_score)
|
cumulative_f1_scores.append(f1_score)
|
||||||
|
|
||||||
return cumulative_f1_scores
|
return cumulative_f1_scores
|
||||||
|
|||||||
Reference in New Issue
Block a user