Worker function for fitting prediction functions (possibly in parallel)

.get_predictions(
  learner,
  Y,
  X,
  K = 10,
  folds,
  parallel,
  nested_cv = FALSE,
  nested_K = K - 1
)

Arguments

learner

The wrapper to use

Y

The outcome

X

The predictors

K

The number of folds

folds

Vector of CV fold assignments

parallel

Whether to compute things in parallel using future

nested_cv

Is nested CV being used?

nested_K

How many folds of nested CV?

Value

A list of the result of the wrapper executed in each fold