Dear R's

I'm trying to use specific rather than random cross-validation groups
in mvpart.

The man page says:
xval Number of cross-validations or vector defining cross-validation groups.


And I found this reply to the list by Terry Therneau from 2006

The rpart function allows one to give the cross-validation groups explicitly.
So if the number of observations was 10, you could use
   > rpart( y ~ x1 + x2, data=mydata, xval=c(1,1,2,2,3,3,1,3,2,1))
which causes observations 1,2,7, and 10 to be left out of the first xval
sample, 3,4, and 9 out of the second, etc.

        Terry Therneau


I can't see how this string of values, c(1,1,2,2,3,3,1,3,2,1), codes
for observations 1,2,7,10 being left out of the 1st and so on.

Can anyone fill me in please?

Thanks,

andydol...@gmail.com

______________________________________________
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.

Reply via email to