data <- MRFcov::Bird.parasites
# Define the response variables of interest
Y <- data %>%
dplyr::select(-scale.prop.zos) %>%
dplyr::select(order(everything()))
# Define the predictors
X <- data %>%
dplyr::select(scale.prop.zos)
# Specify a random forest tidy model
model_lm <- parsnip::logistic_reg()
# Fitting independent multi-response model -----------------------------------
MR_model <- mrIMLpredicts(
X = X,
Y = Y,
Model = model_lm,
prop = 0.7,
k = 5,
racing = FALSE
)
# Fitting a graphical network model -----------------------------------------
# Define the dependent response variables (all in this case)
if (identical(Sys.getenv("NOT_CRAN"), "true")) {
X1 <- Y
GN_model <- mrIMLpredicts(
X = X,
Y = Y,
X1 = X1,
Model = model_lm,
prop = 0.7,
k = 5,
racing = FALSE
)
}
Run the code above in your browser using DataLab