mrBootstrap | R Documentation |
This function bootstraps model predictions and generates variable profiles for each response variable based on the provided yhats.
mrBootstrap(yhats, num_bootstrap = 10, Y = Y, downsample = FALSE)
yhats |
A list of model predictions mrIMLpredicts |
num_bootstrap |
The number of bootstrap samples to generate (default: 10). |
Y |
The response data (default: Y). |
downsample |
Do the bootstrap samples need to be downsampled? Default is FALSE |
A list containing bootstrap samples of variable profiles for each response variable.
## Not run:
# Example usage:
#set up analysis
Y <- dplyr::select(Bird.parasites, -scale.prop.zos)%>%
dplyr::select(sort(names(.)))#response variables eg. SNPs, pathogens, species....
X <- dplyr::select(Bird.parasites, scale.prop.zos) # feature set
X1 <- Y %>%
dplyr::select(sort(names(.)))
model_rf <-
rand_forest(trees = 100, mode = "classification", mtry = tune(), min_n = tune()) %>% #100 trees are set for brevity. Aim to start with 1000
set_engine("randomForest")
yhats_rf <- mrIMLpredicts(X=X, Y=Y,
X1=X1,'Model=model_rf ,
balance_data='no',mode='classification',
tune_grid_size=5,seed = sample.int(1e8, 1),'morans=F,
prop=0.7, k=5, racing=T) #
bs_analysis <- mrBootstrap(yhats=yhats_rf,Y=Y, num_bootstrap = 50)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.