Prev: Simple C-style preprocessor
Next: export figure on mac
From: JN on 16 Feb 2010 18:20 I have a training set and targets that I want to split for n-fold testing, and i want to ensure that all data is used at least once in the testing sample and in the training sample. Now I can of course write a for loop based function that systematically goes through the training and testing set to split them up, in blocks of 90% and 10% - but I imagine there MUST be a better way to do this in matlab? I looked at cvpartition, but it seems to just give me a matrix of (seemingly random) 1 and 0 values - presumably so i can pull out the 90 training / 10 testing cols, is that the best way to do this? im not certain how to proceed.. Thanks!
From: Peter Perkins on 17 Feb 2010 10:04 On 2/16/2010 6:20 PM, JN wrote: > I looked at cvpartition, but it seems to just give me a matrix of > (seemingly random) 1 and 0 values - presumably so i can pull out the 90 > training / 10 testing cols, is that the best way to do this? im not > certain how to proceed. For ungrouped data and k-fold C-V, yes, CVPARTITION gives you indices that are intended to partition the data at random, which is presumably what you'd want in the absence of some criterion that you want to "balance". There are some other options in there too, but k-fold is pretty common. Is your concern with CVPARTITION statistical, or are you asking about more pragmatic concerns having to do with memory and speed and so on? What do you mean by best?
|
Pages: 1 Prev: Simple C-style preprocessor Next: export figure on mac |