Check that an object holds no fitted learner
Source:R/margot_lmtp_checkpoints.R
margot_lmtp_assert_lean.RdWalks `x` (lists and their elements, recursively) and stops if it reaches a fitted learner object: a SuperLearner ensemble (including lmtp's `lmtp_ensemble`), a ranger or randomForest forest, an xgboost booster, a glmnet fit, or an earth or gam fit. Lists are walked; environments (including R6 objects) and attributes are not, so a learner held inside an environment is not detected. Use it at each stage boundary of an analysis to confirm that results kept in memory or saved for reporting hold estimates and diagnostics, not fitted models.
Usage
margot_lmtp_assert_lean(x, what = deparse1(substitute(x)))