# Specific the Validation set in GridSearchCV

For my Strategy that I'm using is doing the cross validation on medical information from 10 patient. So what I am doing is split 1 subject to be validation set and 8 subjects are training sets. And I've implement this problem on gridsearchCV. But the problem is i don't want to perform n-fold cross validation given by gridsearchCV. And i have store my data from into an array

in this pattern : [subject1_dataframe, subject2_dataframe, ..., subject10_dataframe]

And I want to use GridSearchCV to perform the validation by splitting the training set and validation set automatically. What i've try is "PredefinedSplit" that can split by using index but my next problem is my dataset store in array following the above pattern. And gridsearchCV cannot work with this pattern.

Any suggestion to solve this problem?

Is there another ways to optimized the parameters like gridsearchCV and can specific the validation set by myself?

Thank you

Merge your dataframes into a single one using pandas.concat, with axis=0 and ignore_index=True (so that it doesn't use local indices). Make sure they've the same column names, and if not, standardize your columns, because you'll have to deal with a bunch of NaNs and extra columns. Then, generate your fold indices accordingly, using PredefinedSplit or some other way, and input your interested param_grid. If you'll apply one of the listed methods here, they've CV wrappers around them. But, they still need modifications I described above. A whole another way is just simple manual looping throughout your parameter grid.