kroma

kroma.metrics.scoring

Metrics

Metrics are binary. A positive prediction that matches the label is a true positive.

Call

calculate_metrics(y_true, y_pred, positive_label=1)
  -> (precision, recall, f1)

y_true and y_pred are sequences of labels, zipped in order. positive_label defaults to 1.

Source: scoring.py.

Empty input

Precision is 0 when there are no positive predictions. Recall is 0 when there are no positive labels. F1 is 0 when precision and recall are both 0. The function does not raise on an empty pair of lists.