mlrmbo_optimization: Optimization of objective functions via model-based...

View source: R/parameter_optimization.R

mlrmbo_optimizationR Documentation

Optimization of objective functions via model-based optimization (mlrMBO).

Description

mlrmbo_optimization will execute multi-objective model-based optimization of an objective function. The defined surrogate learner here is "kriging".

Usage

mlrmbo_optimization(run_id,obj_fun,niter,ncores,nstart,additional_arguments)

Arguments

run_id

Indicate the id of the optimization run.

obj_fun

An objective function as created by the function mlrMBO::makeMultiObjectiveFunction.

niter

The number of iterations during the optimization process.

ncores

The number of cores on which several parameter settings will be evaluated in parallel.

nstart

The number of different parameter settings used in the begin design.

additional_arguments

A list of named additional arguments that will be passed on the objective function.

Value

A result object from the function mlrMBO::mbo. Among other things, this contains the optimal parameter settings, the output corresponding to every input etc.

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 = lapply(1,mlrmbo_optimization, obj_fun = obj_fun_multi_topology_correction, niter = 3, ncores = 8, nstart = 100, additional_arguments = additional_arguments_topology_correction)


## End(Not run)


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