# \donttest{
# This example assumes your package includes a dataset named 'train_dia'.
# If not, you should create a toy data frame similar to the one below.
#
# train_dia <- data.frame(
# ID = paste0("Patient", 1:100),
# Disease_Status = sample(c(0, 1), 100, replace = TRUE),
# FeatureA = rnorm(100),
# FeatureB = runif(100)
# )
# Ensure the 'train_dia' dataset is available in the environment
# For example, if it is exported by your package:
# data(train_dia)
# Check if 'train_dia' exists, otherwise skip the example
if (exists("train_dia")) {
# 1. Initialize the modeling system
initialize_modeling_system_dia()
# 2. Run selected models
results <- models_dia(
data = train_dia,
model = c("rf", "lasso"), # Run only Random Forest and Lasso
threshold_choices = list(rf = "f1", lasso = 0.6), # Different thresholds
positive_label_value = 1,
negative_label_value = 0,
new_positive_label = "Case",
new_negative_label = "Control",
seed = 42
)
# 3. Print summaries
for (model_name in names(results)) {
print_model_summary_dia(model_name, results[[model_name]])
}
}
# }
Run the code above in your browser using DataLab