def drawGraphsPeriod(data, start, end, date):
'''
??????? ?????? ?????? ????????-??????? ?? ??????
:param data: ?????? ??
:param start: ?????? ?????
:param end: ????? ?????
:param date: ????
:param return: ?????? ?? ??????????
'''
plt.clf()
for i in xrange(3, 4):
actual, predictions = getData(list(data['p' + str(i) + '_Fraud'][start:end]), list(data['CLASS'][start:end]))
precision, recall, thresholds = precision_recall_curve(actual, predictions)
plt.plot(recall, precision, label='%s PRC' % ('p' + str(i) + '_Fraud'))
plt.title('Precision-recall curve for ' + str((date - datetime.timedelta(days=1)).strftime('%Y/%m/%d')))
plt.legend(loc='lower right', fontsize='small')
plt.xlim([0.0,1.0])
plt.ylim([0.0,1.0])
plt.xlabel('Recall')
plt.ylabel('Precision')
plt.show()
评论列表
文章目录