Skip to content
Prev 259112 / 398502 Next

[caret package] [trainControl] supplying predefined partitions to train with cross validation

Hello,

Thank you for your reply but I'm not sure your code answers my needs,
from what I read it creates a 10-fold partition and then extracts the
kth partition for future processing.

My question was rather: once I have a 10-fold partition of my data,
how to supply it to the "train" function of the caret package. Here's
some sample code :

folds <- createFolds(my_dataset_classes, 10)

# I can't use index=folds on this one, it will train on the 1/k and test on k-1
t_control <- trainControl(method="cv", number=10)

# here I would like train to take account of my predefined folds
model <- train(my_dataset_predictors, my_dataset_classes,
method="svmLinear", trControl = t_control)

Cheers,
Fabon.
On Fri, May 6, 2011 at 10:59 AM, neetika nath <nikkihathi at gmail.com> wrote: