extract_sampled_split_predictions: Extract sampled-split predictions from a CV.SuperLearner...

View source: R/extract_sampled_split_predictions.R

extract_sampled_split_predictionsR Documentation

Extract sampled-split predictions from a CV.SuperLearner object

Description

Use the cross-validated Super Learner and a set of specified sample-splitting folds to extract cross-fitted predictions on separate splits of the data. This is primarily for use in cases where you have already fit a CV.SuperLearner and want to use the fitted values to compute variable importance without having to re-fit. The number of folds used in the CV.SuperLearner must be even.

Usage

extract_sampled_split_predictions(
  cvsl_obj = NULL,
  sample_splitting = TRUE,
  sample_splitting_folds = NULL,
  full = TRUE,
  preds = NULL,
  cross_fitting_folds = NULL,
  vector = TRUE
)

Arguments

cvsl_obj

An object of class "CV.SuperLearner"; must be entered unless preds is specified.

sample_splitting

logical; should we use sample-splitting or not? Defaults to TRUE.

sample_splitting_folds

A vector of folds to use for sample splitting

full

logical; is this the fit to all covariates (TRUE) or not (FALSE)?

preds

a vector of predictions; must be entered unless cvsl_obj is specified.

cross_fitting_folds

a vector of folds that were used in cross-fitting.

vector

logical; should we return a vector (where each element is the prediction when the corresponding row is in the validation fold) or a list?

Value

The predictions on validation data in each split-sample fold.

See Also

CV.SuperLearner for usage of the CV.SuperLearner function.


bdwilliamson/nova documentation built on Feb. 1, 2024, 10:04 p.m.