I assume you mean rpart::xpred.rpart ? The beauty of R means that you
can look at the source. For the simple case (where xval is a single
number) the code does indeed do simple random sampling
xgroups<- sample(rep(1:xval, length = nobs), nobs, replace = FALSE)
If you want another sampling, then you simply pass a vector as the xval
parameter, as the documentation says: “This may also be an explicit list
of integers that define the cross-validation groups”.
Hope this helps a little.
Allan
On 19/03/11 09:21, Penny B wrote:
I am trying to find out what type of sampling scheme is used to select the 10
subsets in 10-fold cross-validation process used in rpart to choose the best
tree. Is it simple random sampling? Is there any documentation available on
this?
Thanks, Penny.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.