I wrote my model in R, its new model for classification. prediction part has 600 lines and model 100 lines. they are not like a function. I have to do cross validation for parameter optimization. is there any way to code that or I should run the model different times manually?