View source: R/preprocessing.R
| tl_split | R Documentation |
Split data into train and test sets
tl_split(data, prop = 0.8, stratify = NULL, seed = NULL)
data |
A data frame |
prop |
Proportion for training set (default: 0.8) |
stratify |
Column name for stratified splitting |
seed |
Random seed for reproducibility |
A list with train and test data frames
split_data <- tl_split(iris, prop = 0.7, stratify = "Species")
train <- split_data$train
test <- split_data$test
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.