mrBootstrap | R Documentation |
This function bootstraps model predictions and generates variable profiles for each response variable.
mrBootstrap(mrIMLobj, num_bootstrap = 10, downsample = FALSE)
mrIMLobj |
A list object output by |
num_bootstrap |
The number of bootstrap samples to generate (default: 10). |
downsample |
Logical. Should the bootstrap samples be downsampled? (default: FALSE). |
A list containing bootstrap samples of variable profiles for each response variable.
library(tidymodels)
data <- MRFcov::Bird.parasites
Y <- data %>%
select(-scale.prop.zos) %>%
select(order(everything()))
X <- data %>%
select(scale.prop.zos)
# Specify a random forest tidy model
model_rf <- rand_forest(
trees = 100, # 100 trees are set for brevity. Aim to start with 1000
mode = "classification",
mtry = tune(),
min_n = tune()
) %>%
set_engine("randomForest")
mrIML_rf <- mrIMLpredicts(
X = X,
Y = Y,
X1 = Y,
Model = model_rf,
prop = 0.7,
k = 5
)
#future::plan(multisession, workers = 4)
mrIML_bootstrap <- mrIML_rf %>%
mrBootstrap(
num_bootstrap = 50
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.