tests.py 文件源码

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

项目:DeepAlignmentNetwork 作者: MarekKowalski 项目源码 文件源码
def AUCError(errors, failureThreshold, step=0.0001, showCurve=False):
    nErrors = len(errors)
    xAxis = list(np.arange(0., failureThreshold + step, step))

    ced =  [float(np.count_nonzero([errors <= x])) / nErrors for x in xAxis]

    AUC = simps(ced, x=xAxis) / failureThreshold
    failureRate = 1. - ced[-1]

    print "AUC @ {0}: {1}".format(failureThreshold, AUC)
    print "Failure rate: {0}".format(failureRate)

    if showCurve:
        plt.plot(xAxis, ced)
        plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号