diff --git a/evaluation.py b/evaluation.py index 6390e33..bcace13 100644 --- a/evaluation.py +++ b/evaluation.py @@ -61,10 +61,10 @@ if __name__ == "__main__": FP.append(d) else: FN.append(d) - f_score = len(TP) / (len(TP) + 0.5 * (len(FP) + len(FN))) - accuracy = (len(TP) + len(TF)) / (len(TP) + len(TF) + len(FP) + len(FN)) - precision = len(TP) / ( len(TP) + len(FP) ) - recall = len(TP) / ( len(TP) + len(FN) ) + f_score = len(TP) / (len(TP) + 0.5 * (len(FP) + len(FN)) +0.00001 ) + accuracy = (len(TP) + len(TF)) / (len(TP) + len(TF) + len(FP) + len(FN) +0.00001 ) + precision = len(TP) / ( len(TP) + len(FP) +0.00001 ) + recall = len(TP) / ( len(TP) + len(FN)+0.00001 ) print(f"F- score = {f_score}") print(f"Accuracy = {accuracy}") print(f"Precision = {precision}")