Description Usage Format Methods
Splits a dataset into a train and test set.
1 |
An object of class R6ClassGenerator
of length 24.
initialize(test_set_size = 1)
Creates a new datasplitter
@param test_set_size (default = 1) an integer to specify the size of the test set to use.
split(data)
Splits the data in a train and test set. A block that was used as a test set previously is automatically appended to the traininset (so all data gets used for training that has been used for testing before).
In the current implementation it will always use the last observation as
the test set observation. Eventually this should be configurable, and
n
number of observations should be includable.
@param data data.table the data to spit into a train and test set.
@param test_set_size integer (default = NULL) overrides the initialized
test_set_size. If NULL
, we use the initialized one (default).
@return list with two entries: train
and test
. Each
containing the respective dataframe.
get_test_set_size
Active method. The size of the testset used by this splitter instance.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.