Compute f-measure