Description Usage Arguments Value Examples
Split a dataframe into two dataframes, one for testing and one for training. Very similar to sklearn.model_selection.train_test_split
1 | train.test.split(data, test.size = 0, train.size = 0, shuffle = TRUE)
|
data |
A dataframe to split into test and train |
test.size |
Either an integer indicating the number of rows that should be in test, or a percentage (expressed as a number between 0 and 1) of the number of rows from data that should be in test |
train.size |
Either an integer indicating the number of rows that should be in train, or a percentage (expressed as a number between 0 and 1) of the number of rows from data that should be in train |
shuffle |
A boolean indicating if the dataframe should be shuffled, defaults to TRUE |
A named list where 'test' is the test dataframe and 'train' is the train dataframe
1 2 3 | data("mtcars")
train.test.split(mtcars, train.size = 0.7)
train.test.split(mtcars, test.size = 14)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.