test_emlib.py 文件源码

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

项目:bio-segmentation 作者: mjpekala 项目源码 文件源码
def test_metrics(self):
        Y = np.random.randint(0,2,size=(2,5,5))
        Yhat = np.random.randint(0,2,size=(2,5,5))

        C,acc,prec,recall,f1 = emlib.metrics(Y, Yhat, display=False)
        prec2, recall2, f12, supp = smetrics(np.reshape(Y, (Y.size,)), 
                np.reshape(Yhat, (Yhat.size,)))

        self.assertAlmostEqual(prec, prec2[1])
        self.assertAlmostEqual(recall, recall2[1])
        self.assertAlmostEqual(f1, f12[1])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号