task: Generate task

View source: R/task.R

taskR Documentation

Generate task

Description

This functions enables users to create a task, which mainly describes the optimization problem. Task is required for many EBO functions, such as EBO::optimizertuneRace(), EBO::generateConfigdata() or EBO::generateProblemList().

Usage

task(simulation = "regr.randomForest", data, target, psOpt, minimize = TRUE)

Arguments

simulation

[character]
The black box function e.g. model for the mlrMBO Default is 'regr.randomForest'.

data

[data.frame]
Data of problem.

target

[character]
The variable, which one wants to minimize (maximize) mlrMBO.

psOpt

[ParamHelpers::ParamSet()]
Collection of parameters and their constraints for problem optimization

minimize

[logical(1)]
Should the target be minimized?
Default is 'TRUE'.

Value

List with relevant informations of a specific problem.

Examples

## Not run: 
set.seed(1)

library(mlrMBO)
library(ParamHelpers)
library(mlr)

set.seed(1)

# define problem / task
data <- data.frame(a = runif(50,10,5555), b = runif(50,-30000,-500),
                   c = runif(50,0,1000))
data$ratio <- rowSums(data[,1:3]^2)
data$ratio <- data$ratio/max(data$ratio)
colnames(data) <- c("power", "time", "pressure","ratio")

psOpt = makeParamSet(

 makeIntegerParam("power", lower = 10, upper = 5555),

 makeIntegerParam("time", lower = -30000, upper = -500),

 makeIntegerParam("pressure", lower = 0, upper = 1000)
)

task = task(
 simulation = "regr.randomForest",
 data = data,
 target = "ratio",
 psOpt = psOpt,
 minimize = FALSE
)

## End(Not run)

matthiasgruber/EBO documentation built on May 17, 2022, 3:19 p.m.