Skip to contents

This function bootstraps model predictions and generates variable profiles for each response variable based on the provided yhats.

Usage

mrBootstrap(
  yhats,
  num_bootstrap = 10,
  Y = Y,
  downsample = FALSE,
  mode = "classification"
)

Arguments

yhats

A list of model predictions (e.g., from mrIMLpredicts).

num_bootstrap

The number of bootstrap samples to generate (default: 10).

Y

The response data.

downsample

Logical. Should the bootstrap samples be downsampled? (default: FALSE).

mode

character: 'classification' or 'regression' depending on the model type.

Value

A list containing bootstrap samples of variable profiles for each response variable.

Examples

if (FALSE) { # \dontrun{
# Example usage:

# Prepare response data
Y <- dplyr::select(Bird.parasites, -scale.prop.zos) %>% 
       dplyr::select(sort(names(.))) # Response variables (e.g., SNPs, pathogens, species)

# Example list of yhats generated from mrIMLpredicts (assume yhats_rf is defined)
yhats_rf <- mrIMLpredicts(...)  # Replace with actual code to generate yhats_rf

# Perform bootstrap analysis
bs_analysis <- mrBootstrap(yhats = yhats_rf, Y = Y, num_bootstrap = 50, mode = 'classification')
} # }