View source: R/dgp-lib-utils.R
split_data | R Documentation |
Helper function to split data into training and test sets
split_data(X, y, train_prop = 0.5)
X |
Data matrix or data frame. |
y |
Response vector. |
train_prop |
Proportion of data in training set. |
A list of four: "X", "y", "Xtest", and "ytest" containing the training data, training response, test data, and test response, respectively.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.