True Positive 数量:
counter = 0
pre2 = clf.predict(features_test)
print pre2
for index,value in enumerate(pre2):if value == labels_test[index] == 1:counter +=1
print "The number of True Positive:",counter
# for i in pre2: # if i == labels_test[int(i)] == 1: # counter +=1
reference:
点击打开链接
点击打开链接