Moved the crossvalidation building indeces out of the preprocessing function