This function wraps a learner in such a way that the behavior of learner$chain is modified to use a new function definition. learner$train and learner$predict are unaffected.

customize_chain(learner, chain_fun)

Format

R6Class object.

Arguments

learner

A sl3 learner to modify.

chain_fun

A function with arguments learner and task that defines the new chain behavior.

Value

Lrnr_base object with methods for training and prediction

Fields

params

A list of learners to chain.

Methods

new(...)

This method is used to create a pipeline of learners. Arguments should be indiviual Learners, in the order they should be applied.