hyperopt: Tune Hyperparameters for a machine learning task

Description Usage Arguments Value Examples

View source: R/hyperopt.R

Description

Tunes the Hyperparameters for a given task and learner. Tries to find the best parameter set to tune for the given learner.

Usage

1
2
3
4
5
6
7
hyperopt(
  task,
  learner = NULL,
  par.config = NULL,
  hyper.control = NULL,
  show.info = getMlrOptions()$show.info
)

Arguments

task

[Task] The Task

learner

[Learner] The learner that is subject to the Hyperparameter Tuning. If no learner is given the learner referenced in the par.config will be used, if available.

par.config

[ParConfig] The Parameter Configuration

hyper.control

[HyperControl] The Hyperparameter Control Object

show.info

[logical(1)]
Print verbose output on console? Default is set via configureMlr.

Value

[TuneResult]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# the shortest way of hyperparameter optimization
hyperopt(iris.task, "classif.svm")

# manually defining the paramer space configuration
par.config = makeParConfig(
  par.set = makeParamSet(
    makeIntegerParam("mtry", lower = 1, upper = 4),
    makeDiscreteParam("ntree", values = c(10, 25, 50))
  ),
  par.vals = list(replace = FALSE),
  learner.name = "randomForest"
)
hyperopt(bh.task, par.config = par.config)

jakob-r/mlrHyperopt documentation built on Jan. 10, 2022, 4:32 p.m.