How do I sequentially partition the folds in cross validation?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I’m working on a partial least squares regression problem where I want to set up cross validation with a cvpartition object. However, I can’t seem to figure out how to make it partition the folds so that the observations are picked consecutively, which I need them to be.
If I write:
c = cvpartition(length(Y),'KFold',10)
it just partitions the folds randomly if I understand the documentation correct. In fact, every option I’ve read about in the documentation seems to be based on random partitioning. Surely there has to be an option for consecutively partitioning the observations?
One idea I had was to first create a random cvpartition object and then manipulate it by manually forcing the object to use indices that I assign in each fold like this:
c.training(i) = TrainIndex(i,:)'
but matlab doesn’t seem to give me permission to do that.
Does anyone know how to do this? If my data for example goes from 1 to 100 I want my folds to consist of 1:10, 11:20, 21:30 etc. or something like that.
Thanks.
0 comentarios
Respuestas (1)
Jo
el 4 de Nov. de 2016
Hi Petter,
Did you find a way to do what you wanted ?
I need to choose my own subsets for the cross-validation and not random ones for optimizing SVM parameters.
And I cannot find a solution. Please tell me if you have one...
Thanks
0 comentarios
Ver también
Categorías
Más información sobre Gaussian Process Regression en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!