Skip to content
Prev 180493 / 398525 Next

Using sample to create Training and Test sets

The caret package has a function, createDataPartition, that does the
split taking into account the distribution of the outcome. This might
be good in classification cases where one or more classes have low
percentages in the data set.

There is more detail in the pdf:

 http://cran.r-project.org/web/packages/caret/vignettes/caretMisc.pdf

and examples in this pdf

  http://cran.r-project.org/web/packages/caret/vignettes/caretTrain.pdf

Max