process_mlrmbo_nichenet_optimization: Process the output of mlrmbo multi-objective optimization to...

View source: R/parameter_optimization.R

process_mlrmbo_nichenet_optimizationR Documentation

Process the output of mlrmbo multi-objective optimization to extract optimal parameter values.

Description

process_mlrmbo_nichenet_optimization will process the output of multi-objective mlrmbo optimization. As a result, a list containing the optimal parameter values for model construction will be returned.

Usage

process_mlrmbo_nichenet_optimization(optimization_results,source_names,parameter_set_index = NULL)

Arguments

optimization_results

A list generated as output from multi-objective optimization by mlrMBO. Should contain the elements $pareto.front, $pareto.set See mlrmbo_optimization.

source_names

Character vector containing the names of the data sources. The order of data source names accords to the order of weights in x$source_weights.

parameter_set_index

Number indicating which of the proposed solutions must be selected to extract optimal parameters. If NULL: the solution with the highest geometric mean will be selected. Default: NULL.

Value

A list containing the parameter values leading to maximal performance and thus with the following elements: $source_weight_df, $lr_sig_hub, $gr_hub, $ltf_cutoff, $damping_factor

Examples

## Not run: 
library(dplyr)
library(mlrMBO)
library(parallelMap)
additional_arguments_topology_correction = list(source_names = source_weights_df$source %>% unique(), algorithm = "PPR", correct_topology = TRUE,lr_network = lr_network, sig_network = sig_network, gr_network = gr_network, settings = lapply(expression_settings_validation,convert_expression_settings_evaluation), secondary_targets = FALSE, remove_direct_links = "no", cutoff_method = "quantile")
nr_datasources = additional_arguments_topology_correction$source_names %>% length()

obj_fun_multi_topology_correction = makeMultiObjectiveFunction(name = "nichenet_optimization",description = "data source weight and hyperparameter optimization: expensive black-box function", fn = model_evaluation_optimization, par.set = makeParamSet( makeNumericVectorParam("source_weights", len = nr_datasources, lower = 0, upper = 1), makeNumericVectorParam("lr_sig_hub", len = 1, lower = 0, upper = 1),  makeNumericVectorParam("gr_hub", len = 1, lower = 0, upper = 1),  makeNumericVectorParam("damping_factor", len = 1, lower = 0, upper = 0.99)), has.simple.signature = FALSE,n.objectives = 4, noisy = FALSE,minimize = c(FALSE,FALSE,FALSE,FALSE))

mlrmbo_optimization_result = lapply(1,mlrmbo_optimization, obj_fun = obj_fun_multi_topology_correction, niter = 3, ncores = 8, nstart = 100, additional_arguments = additional_arguments_topology_correction)
optimized_parameters = process_mlrmbo_nichenet_optimization(mlrmbo_optimization_result[[1]],additional_arguments_topology_correction$source_names)


## End(Not run)


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