def eval_perf(classification):
y_true = []
y_pred = []
for (key, value) in classification.iteritems():
y_true.extend([parse_class(key)])
y_pred.extend([value])
print_verbose("Classification pair: %s" % str((key, value)), 4)
print_verbose("True classes: %s" % str(y_true), 5)
print_verbose("Predicted classes: %s" % str(y_pred), 5)
# Print results
print_verbose("True classes: %s" % str(y_true), 2)
print_verbose("Predicted classes: %s" % str(y_pred), 2)
# Print metrics
print_verbose("Confusion Matrix:", 0)
print_verbose(metrics.confusion_matrix(y_true, y_pred), 0)
print_verbose("Classification Report:", 0)
print_verbose(metrics.classification_report(y_true, y_pred), 0)
评论列表
文章目录