visualize_parameter_values_across_folds: Visualize parameter values from the output of...

visualize_parameter_values_across_foldsR Documentation

Visualize parameter values from the output of run_nsga2R_cluster across cross-validation folds.

Description

visualize_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.

Usage

visualize_parameter_values_across_folds(result_nsga2r_list, source_names, top_n = 25)

Arguments

result_nsga2r_list

A list containing the outputs of run_nsga2R_cluster for each cross-validation fold.

source_names

Character vector containing the names of the data sources.

top_n

Numeric indicating how many of the best solutions should be considered.

Value

A list containing two ggplot objects, one for the data source weights and one for the hyperparameters.

Examples

## Not run: 
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)

## End(Not run)


saeyslab/nichenetr documentation built on Sept. 7, 2024, 10:27 a.m.