1
$\begingroup$

I am trying to compare two different models with cross validation and I am not sure whether I choosed an effective way to split my dataset into equal sized partitions. My data frame is called anne and I tried this before the loop:

anne<-anne[sample(nrow(anne)),]
my_folds<- cut(seq(1,nrow(anne)),breaks=10,labels=FALSE) 

Since I want to do comparisons of different models the partions are very important.

Question 1.

Is this a good way to create my partitions?

Question 2.

Is it better if I use the createDataPartition from caret package?

(e.g createDataPartition(anne$response, p=.80, list=FALSE)

ps. I also used the set.seed

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.