compute purity (precision) and completeness (recall) in cross-validation