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)

Arguments

learner

sl3 learner to modify

chain_fun

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