How do I sequentially partition the folds in cross validation?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Jo
2016-11-4
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!