Re: [R] cross-validation in rpart

2011-03-19 Thread Prof Brian Ripley
On Sat, 19 Mar 2011, 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? Not SRS (and least in

Re: [R] cross-validation in rpart

2011-03-19 Thread Allan Engelhardt
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,

[R] cross-validation in rpart

2011-03-19 Thread Penny B
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. -- View this message in context: http://r.78

Re: [R] cross-validation in rpart

2009-05-26 Thread Paolo Radaelli
Dear R users, I know cross-validation does not work in rpart with user defined split functions. As Terry Therneau suggested, one can use the xpred.rpart function and then summarize the matrix of the predicted values into a single "goodness" value. I need only a confirmation: set for example xva

Re: [R] cross-validation in rpart

2008-07-07 Thread Terry Therneau
-- begin included message I'm having a problem with custom functions in rpart, and before I tear my hair out trying to fix it, I want to make sure it's actually a problem. It seems that, when you write custom functions for rpart (init, split and eval) then rpart no longer cross-validates the resul

[R] cross-validation in rpart

2008-07-03 Thread Sam Stewart
Hello list, I'm having a problem with custom functions in rpart, and before I tear my hair out trying to fix it, I want to make sure it's actually a problem. It seems that, when you write custom functions for rpart (init, split and eval) then rpart no longer cross-validates the resulting tree to

[R] Cross Validation in rpart

2008-02-22 Thread R Help
Hello All, I'm writing a custom rpart function, and I'm wondering about cross-validation. Specifically, why isn't my splitting function being called more often with the xval increased? One would expect that, with xval=10 compared to xval=1, that the prior would call the splitting function mo