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
评论列表
文章目录