mlr3 (version 0.1.4)

ResamplingCV: Cross Validation Resampling

Description

Splits data using a folds-folds (default: 10 folds) cross-validation.

Arguments

Format

R6::R6Class inheriting from Resampling.

Construction

ResamplingCV$new()
mlr_resamplings$get("cv")
rsmp("cv")

Fields

See Resampling.

Methods

See Resampling.

Parameters

  • folds :: integer(1) Number of folds.

See Also

Dictionary of Resamplings: mlr_resamplings

as.data.table(mlr_resamplings) for a complete table of all (also dynamically created) Resampling implementations.

Examples

Run this code
# NOT RUN {
# Create a task with 10 observations
task = tsk("iris")
task$filter(1:10)

# Instantiate Resampling
rcv = rsmp("cv", folds = 3)
rcv$instantiate(task)

# Individual sets:
rcv$train_set(1)
rcv$test_set(1)
intersect(rcv$train_set(1), rcv$test_set(1))

# Internal storage:
rcv$instance # table
# }

Run the code above in your browser using DataCamp Workspace