learn_cvpairs: Cross-validation pairs

Description Usage Arguments Details See Also Examples

Description

Customise cross validation pairs of training and test data for pipelearner object. By default, a single cross validation pair will be created with a random 80 testing. learn_cvpairs allows this to be customised through the use of a function that takes a data.frame as input and returns a data.frame with three columns: train, test, and .id. train and test must be list-columns of resample objects, and .id is an atomic vector of unique values.

Usage

1
learn_cvpairs(pl, .f, ...)

Arguments

pl

pipelearner object. See pipelearner

.f

function like crossv_mc that partitions a data.frame into test-training splits. .f must have an argument data, which takes a data.frame. .f must return a data.frame with two list-columns of resample objects ("train" and "test") and a column of unique atomic values (".id"). of unique values.

...

additional parameters to be passed to .f

Details

Will expect a pipelearner object, but will also accept a data frame for the parameter pl. In the case that a data frame is used, it will first coerce it to a pipelearner object via pipelearner.

See Also

Example functions that can be used for argument .f: crossv_mc, crossv_kfold

Examples

1
2
3
# Five-fold cross validation
pl <- pipelearner(mtcars)
learn_cvpairs(pl, crossv_kfold, k = 5)

drsimonj/pipelearner documentation built on May 15, 2019, 2:53 p.m.