def display_pr_curve(precision, recall):
# following examples from sklearn
# TODO: f1 operating point
import pylab as plt
# Plot Precision-Recall curve
plt.clf()
plt.plot(recall, precision, label='Precision-Recall curve')
plt.xlabel('Recall')
plt.ylabel('Precision')
plt.ylim([0.0, 1.05])
plt.xlim([0.0, 1.0])
plt.title('Precision-Recall example: Max f1={0:0.2f}'.format(max_f1))
plt.legend(loc="lower left")
plt.show()
评论列表
文章目录