Visualize parameter values from the output of run_nsga2R_cluster across cross-validation folds.
Source: R/parameter_optimization.R
visualize_parameter_values_across_folds.Rdvisualize_parameter_values_across_folds will take as input the output of run_nsga2R_cluster and visualize the data source weights and hyperparameters of the best solutions across all folds.
Value
A list containing two ggplot objects, one for the data source weights and one for the hyperparameters.
Examples
if (FALSE) { # \dontrun{
results_list <- lapply(cv_folds, function(fold) {
settings <- readRDS(paste0("settings_training_f", fold))$settings
forbidden_gr <- bind_rows(
gr_network %>% filter(database == "NicheNet_LT" & from %in% settings$forbidden_ligands_nichenet),
gr_network %>% filter(database == "CytoSig" & from %in% settings$forbidden_ligands_cytosig)
)
gr_network_subset <- gr_network %>% setdiff(forbidden_gr)
run_nsga2R_cluster(model_evaluation_optimization_nsga2r,
varNo = n_param, objDim = n_obj,
lowerBounds = lower_bounds, upperBounds = upper_bounds, popSize = 360, tourSize = 2, generations = 15, ncores = 8,
source_names = source_names, algorithm = "PPR", correct_topology = FALSE, lr_network = lr_network, sig_network = lr_network, gr_network = gr_network_subset,
settings = settings, secondary_targets = FALSE, remove_direct_links = "no", damping_factor = NULL
)
})
# Visualize the best 25 solutions across all folds
visualize_parameter_values_across_folds(results_list, source_names, top_n = 25)
} # }