langtest.utils.util_metrics.classification_report#

classification_report(y_true: List[str | int], y_pred: List[str | int], zero_division: int = 0) Dict[str, Dict[str, float | int]]#

Generate a classification report including precision, recall, f1-score, and support.

Parameters:
  • y_true (List[Union[str, int]]) – List of true labels.

  • y_pred (List[Union[str, int]]) – List of predicted labels.

  • zero_division (int, optional) – Specifies the value to return when there is a zero division case, i.e., when all predictions and true values are negative. Defaults to 0.

Returns:

Classification report, each class has a dictionary containing precision, recall, f1-score, and support.

Return type:

Dict[str, Dict[str, Union[float, int]]]