creating cross-validation using externally created folds

Hey all,

I'm new in Knime and I hope you will be able to help me.

I'm trying to build a workflow to perform cross validation when I use previously created splits (5 folds). Each time I use 4 folds to train model and 1 different fold is used for prediction so that at the end my all dataset is predicted by a model that never saw this part of a dataset before. I want to get statistics for each fold separately and for the whole dataset. I include here part of this workflow that builds a model based on the training set. Each time different 4 folds are used as a training set for modeling. The content of each fold is stored in txt files (trn1.txt, trn2.txt, ...trn5.txt  and tst1.txt, tst2.txt...tst5.txt). Each time a model is build I want to use it to predict an external fold I set aside. What is the best way to do it? Names of the txt files are stored in the table as variables.

Thank you in advance    

You could use a row splitter inside a loop to exclude a particular fold (iterating over the file name / fold ID) do all your calculations and output to the two ports loop end. One port would get the performance for the fold and the other the predicictions for the fold.