def plot(self, output_file):
self.ax1.plot([0, 1], [0, 1], '--', lw = 1,
color = (0.6, 0.6, 0.6), label = 'Luck')
if self.num_folds > 1:
self.mean_tpr /= self.num_folds
self.mean_tpr[-1] = 1.0
mean_auc = auc(self.mean_fpr, self.mean_tpr)
self.ax1.plot(self.mean_fpr, self.mean_tpr, 'k--',
label = 'Mean ROC (area = %0.2f)' % mean_auc, lw = 2)
self.ax1.set_xlim([-0.05, 1.05])
self.ax1.set_ylim([-0.05, 1.05])
self.ax1.set_xlabel('False Positive Rate')
self.ax1.set_ylabel('True Positive Rate')
self.ax1.set_title('ROC Curve')
self.ax1.legend(loc = 'lower right')
self.fig.savefig(output_file)
plt.close(self.fig)
评论列表
文章目录