Description Usage Arguments Details Value See Also Examples
Returns the row indices of x
that should go to training or validation.
1 2 3 4 5 6 7 8 |
x |
A vector used for splitting data |
type |
Character. Type of partition. Valid values are |
p |
percentage of data that goes to training set (holdout). Only
relevant if |
kfold |
Number of folds for cross-validation. Only relevant if |
groups |
For |
returnTrain |
Logical indicating whether training or validation indices should be returned. Default is TRUE. |
Three types of splits are currently implemented. "random holdout"
randomly
selects p
percents of x
for the training set. "group holdout"
first groups x
into groups
quantiles and randomly samples
within them (see createDataPartition
) . "kfold"
creates k folds where p percent of the data is used for training in each fold
(see createFolds
). This function is a wrapper around two functions of
caret
package: createDataPartition
and
createFolds
List containing training or validation indices
1 2 3 4 5 | # sample_points is a SpatialPointsDataFrame calculated and saved from getSample
# Load it into memory
load(system.file("extdata/examples/sample_points.RData",package="foster"))
partition(sample_points$cluster, type = "kfold", kfold = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.