Helper function to properly format partially cross-validated predictions from a fitted super learner.
partial_cv_preds(fit_sl, a_0, W = NULL, family, include = NULL, easy = FALSE)A fitted SuperLearner object with
control$saveCVFitLibrary = TRUE
Treatment level to set. If NULL, assume this function
is being used to get partially cross-validated propensity score predictions.
A data.frame of named covariates.
Family of prediction model
A boolean vector indicating which observations were actually used to fit the regression.
A boolean indicating whether the predictions can be computed the "easy" way, i.e., based just on the Z matrix from SuperLearner. This is possible for propensity score models when no missing data AND no stratification.