Klassifizierungsgenauigkeit nach Rückruf und Genauigkeit
Ich frage mich nur, ob dies eine legitime Methode zur Berechnung der Klassifizierungsgenauigkeit ist:
präzise Rückrufschwellenwerte erhaltenfür jeden Schwellwert werden die fortlaufenden y_scores @ digitalisiererechnen Sie ihre Genauigkeit anhand der Kontingenztabelle (Verwirrungsmatrixdie durchschnittliche Genauigkeit für die Schwellenwerte zurückgeben
recall, precision, thresholds = precision_recall_curve(np.array(np_y_true), np.array(np_y_scores))
accuracy = 0
for threshold in thresholds:
contingency_table = confusion_matrix(np_y_true, binarize(np_y_scores, threshold=threshold)[0])
accuracy += (float(contingency_table[0][0]) + float(contingency_table[1][1]))/float(np.sum(contingency_table))
print "Classification accuracy is: {}".format(accuracy/len(thresholds))