calculate precision, recall, F1, accuracy, etc. PR: 60726 Submitted by: Cheng-Lung Sung <clsung@dragon2.net>