<reponame>strawberryfg/xraygan<filename>full_code/precision-recall.py<gh_stars>1-10
from sklearn.metrics import precision_score, recall_score, average_precision_score
y_true = [0, 1, 2, 0, 1, 2]
y_pred = [0, 2, 1, 0, 0, 1]
precision_score(y_true, y_pred, average='micro')
recall_score(y_true, y_pred, average='micro')

average_precision = average_precision_score(y_test, y_score)
print('Average precision-recall score: {0:0.2f}'.format(
      average_precision))
