Skip to contents

Creates a split of the row ids of a Task into a training and a test set, and optionally a validation set.

Usage

# S3 method for class 'TaskFcst'
partition(task, ratio = 0.67)

Arguments

task

(Task)
Task to operate on.

ratio

(numeric())
Ratio of observations to put into the training set. If a 2 element vector is provided, the first element is the ratio for the training set, the second element is the ratio for the test set. The validation set will contain the remaining observations.

Examples

task = tsk("airpassengers")
split = partition(task, ratio = 0.8)