get_partition_indices | R Documentation |
Use this function to get the row indices for the training set.
get_partition_indices(
outcomes,
training_frac = 0.8,
groups = NULL,
group_partitions = NULL
)
outcomes |
vector of outcomes |
training_frac |
Fraction of data for training set (default: |
groups |
Vector of groups to keep together when splitting the data into
train and test sets. If the number of groups in the training set is larger
than |
group_partitions |
Specify how to assign |
If groups
is NULL
, uses createDataPartition.
Otherwise, uses create_grouped_data_partition()
.
Set the seed prior to calling this function if you would like your data partitions to be reproducible (recommended).
Vector of row indices for the training set.
Kelly Sovacool, sovacool@umich.edu
training_inds <- get_partition_indices(otu_mini_bin$dx)
train_data <- otu_mini_bin[training_inds, ]
test_data <- otu_mini_bin[-training_inds, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.