Implement cross-validation for logistic models