ROC.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:SecuML 作者: ANSSI-FR 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号