freeEDU/Log-Decoder
0
1"""2The utility functions of loglizer3 4Authors: 5 LogPAI Team6 7"""8 9from sklearn.metrics import precision_recall_fscore_support10import numpy as np11 12 13def metrics(y_pred, y_true):14 """ Calucate evaluation metrics for precision, recall, and f1.15 16 Arguments17 ---------18 y_pred: ndarry, the predicted result list19 y_true: ndarray, the ground truth label list20 21 Returns22 -------23 precision: float, precision value24 recall: float, recall value25 f1: float, f1 measure value26 """27 precision, recall, f1, _ = precision_recall_fscore_support(y_true, y_pred, average='binary')28 return precision, recall, f129 30 