classify.py 文件源码

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

项目:hco-experiments 作者: zooniverse 项目源码 文件源码
def print_misclassified(y, pred, files, fom_func, threshold):

    #fpr, tpr, thresholds = roc_curve(y, pred)

    #fom = 0.01

    #FoMs.append(1-tpr[np.where(fpr<=FPR)[0][-1]])
    #FoM, threshold, fpr, tpr = fom_func(y, pred, fom)
    negatives = np.where(y==0)
    positives = np.where(y==1)

    falsePositives = files[negatives][np.where(pred[negatives]>threshold)]

    print "[+] False positives (%d):" % len(falsePositives)
    for i,falsePositive in enumerate(falsePositives):
        print "\t " + str(falsePositive), pred[negatives][np.where(pred[negatives]>threshold)][i]
    print
    missedDetections = files[positives][np.where(pred[positives]<=threshold)]
    print "[+] Missed Detections (%d):" % len(missedDetections)
    for i,missedDetection in enumerate(missedDetections):
        print "\t " + str(missedDetection), pred[positives][np.where(pred[positives]<=threshold)][i]
    print
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号