partition: Split data into training and testing sets

Description Usage Arguments Details See Also

Description

Returns the row indices of x that should go to training or testing.

Usage

1
2
partition(x, type = "group holdout", p = 0.75, groups = min(5,
  length(x)), returnTrain = TRUE)

Arguments

x

A vector used for splitting data

type

Character. How should data be split? Valid values are "random holdout" , "group holdout" or "kfold"

p

percentage of data that goes to training set (holdout) or to each fold (1/k)

groups

For "group holdout" and when x is numeric, this is the number of breaks in the quantiles

returnTrain

Logical indicating whether training data or testing data should be returned

Details

Three types of splits are currently implemented. "random holdout" randomly select p percents of x for the training set. 'group holdout" first groups x into groups quantiles and randomly samples within them. "kfold" creates k folds where p percent of the data is used for training in each fold. This function is a wrapper around two functions of caret package: createDataPartition and createDataPartition

See Also

createDataPartition


mqueinnec/foster documentation built on June 3, 2019, 4:22 a.m.