I did a classification project and now I need to calculate the weighted average precision, recall and f-measure, but I don't know their formulas. some files are two classes, some are three classes and some are four classes. I need the formulas containing tp1, fp1, fn1, tn1, tp2, fp2, fn2, tn2 and .... And also I need the reference, too, because I have to refer to it in my thesis.