View source: R/DataPartition.R
DataPartition | R Documentation |
Data Partition
DataPartition(data = NULL, outcome = NULL, proportion = 0.7, seed = 2022)
data |
A |
outcome |
A character string with the name of the outcome variable from the data. |
proportion |
A numeric value for the proportion of data to be put into model training. Default is set to 0.7. |
seed |
A numeric value for set.seed. It is set to be 2022 by default. |
This function returns a list with training and testing data sets using a stratified selection by the outcome variable as performed by the createDataPartition function from the caret package.
dp <- DataPartition(data = cp025q01.wgt, outcome = "outcome")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.