This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2023-05-25 15:30:02 +08:00

12 lines
304 B
Python

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