metatuner: Metaheuristics tuner

Description Usage Arguments Tunable Parameters Tuning Instances Algorithm Runner Initial Sampling Methods Statistical Modeling Optimization Methods

View source: R/metatuner.R

Description

Search for parameter configurations that are expected to yield the best performance for a given optimizer on instances belonging to the same problem class as those used in the tuning effort. Currently the method only works for parameters that are box-constained, continuous, and Real.

Usage

1
2
3
4
5
6
metatuner(parameters, tuning.instances, algo.runner, elite.confs, budget,
  m0 = 3 * nrow(parameters), mi = 5L, initial.sampling = "lhs",
  ndigits = 3L, N0 = 5L, Ni = 1L, summary.function = "median",
  model.type = "quantile", model.order = 3L,
  optimization.method = "Nelder-Mead", ncores = 1L,
  seed = as.integer(Sys.time()))

Arguments

parameters

data frame containing the parameter names and bound constraints. See Section Tunable Parameters for details.

tuning.instances

list of instances available for tuning. See Section Tuning Instances for details.

algo.runner

name of function used for evaluating the configurations. See Section Algorithm Runner for details.

elite.confs

number of elite configurations to maintain at each iteration.

budget

number of algorithm runs allocated for the tuning effort.

m0

initial number of configurations to be generated. Defaults to 3 * nrow(parameters).

mi

number of new configurations to generate at each iteration. Defaults to 5.

initial.sampling

type of method to be used in the generation of the initial sample. See Section Initial Sampling Methods for details. Defaults to "lhs".

ndigits

integer with the number of digits to use as the resolution of each parameter (i.e., the parameter will have (10 ^ ndigits) possible values during the tuning process). Accepts a vector input, if different resolutions are desired for different parameters. Defaults to 3.

N0

initial number of instances to sample. Defaults to 5.

Ni

number of new instances to add at each iteration. Defaults to 1.

summary.function

name of function for aggregating the (scaled) output values of algo.runner into a single performance value. Usual values include "mean" and "median", but in principle any summarizing function can be used.

model.type

Type of regression model to use. See Section Statistical Models for details.

model.order

Order of the model to fit. Defaults to 3.

optimization.method

optimization method to use for estimating new configurations. See Section Optimization Methods for details. Defaults to "Nelder-Mead".

ncores

number of processor cores to use. Receives either an integer or the value "max", in which case the method uses all available cores, minus one.

seed

seed for the random number generator. Use a scalar integer value.

Tunable Parameters

The parameters to be tuned are passed to metatuner as a data frame containing three columns:

Tuning Instances

The problem instances available for the tuning effort must be passed as list vector tuning.instances, in which each position contains the following fields:

Algorithm Runner

The algo.runner parameter points to a function that receive the instance configuration (i.e., one element of the list vector tuning.instance) and a numeric vector with the values of the tunable parameters (e.g., myalgo <- function(instance, params){...}), and return a single scalar quantifying the performance of the algorithm equipped with that configuration for that particular instance.

IMPORTANT: metatuner assumes one wants to minimize the expected output of algo.runner. When working with quality indicators that should be maximize, please do not forget to multiply this output by -1 in the output of algo.runner.

Initial Sampling Methods

metatuner generates the initial sampling of the space of configurations using the method given in initial.sampling. Currently available methods are:

Statistical Modeling

Parameter model.type informs metatuner of the type of regression model to fit. Currently implemented alternatives are:

In all cases metatuner fits a polynomial model to the performance data gathered from running the candidate configurations on the tuning instances. Parameter model.order is used to inform the (maximum) order of the polynomial model to be fitted.

Optimization Methods

metatuner uses stats::constrOptim() to optimize the predicted quality of algo.runner with regards to its tunable parameters. Any method that does not require an explicit function for returning gradient / Hessian information can be used as optimization.method. Currently we recommend using Nelder-Mead, but SANN is also a (usually slower) possibility.


fcampelo/MetaTuner documentation built on May 29, 2019, 9:14 a.m.