首次提交本地代码

This commit is contained in:
zyq
2023-05-25 15:30:02 +08:00
parent 0ead9d742b
commit 2236622f33
27 changed files with 453475 additions and 0 deletions

12
evaluation/f1.py Normal file
View File

@@ -0,0 +1,12 @@
from sklearn.metrics import f1_score, precision_score, recall_score
def evaluate(y_true: list, y_pred: list) -> float:
"""
F1评估方法
:param y_true: 真实标签
:param y_pred: 检测标签
:return: f1、recall、precision
"""
f1 = f1_score(y_true, y_pred)
return f1