A rather general implementation to be used with learner$new can look something like this
learner_fallback(original, fallback) { … }
original, fallback are both learner objects
- estimation fails for original learner - > use fallback learner
- prediction fails for original learner -> use fallback learner (therefore, we always need to estimate the fallback learner)
2 checks
- convergence
- error during estimation -> tryCatch
We should review if we need this fallback behaviour only for the superlearner. I can only come up with rare use-cases (mostly for debugging or experimentation) where one would like this feature to be available for a single learner to be used as the outcome.model in cate. This can obviously be done by using learner_sl with a single base learner and fallback learner.
A rather general implementation to be used with
learner$newcan look something like thislearner_fallback(original, fallback) { … }
original, fallback are both learner objects
2 checks
We should review if we need this fallback behaviour only for the superlearner. I can only come up with rare use-cases (mostly for debugging or experimentation) where one would like this feature to be available for a single learner to be used as the
outcome.modelincate. This can obviously be done by usinglearner_slwith a single base learner and fallback learner.