added support for leave-one-out cross-validation.