code to evaluate a classifier by k-fold cross validation.