mlr-org mlr3tuning v0.4.0.9000
  • Reference
  • Changelog
  • mlr3book

mlr3tuning

Package website: release | dev

tic CRAN Status StackOverflow Mattermost

This package provides hyperparameter tuning for mlr3. It offers various tuning methods e.g. grid search, random search and generalized simulated annealing and different termination criteria can be set and combined. ‘AutoTuner’ provides a convenient way to perform nested resampling in combination with ‘mlr3’. The package is build on bbotk which provides a common framework for optimization.

Installation

CRAN version

install.packages("mlr3tuning")

Development version

remotes::install_github("mlr-org/mlr3tuning")

Example

library("mlr3")
library("mlr3tuning")
library("paradox")

task = tsk("pima")
learner = lrn("classif.rpart")
resampling = rsmp("holdout")
measure = msr("classif.ce")

# Create the search space with lower and upper bounds
search_space = ParamSet$new(list(
  ParamDbl$new("cp", lower = 0.001, upper = 0.1),
  ParamInt$new("minsplit", lower = 1, upper = 10)
))

# Define termination criterion
terminator = trm("evals", n_evals = 20)

# Create tuning instance
instance = TuningInstanceSingleCrit$new(task = task,
  learner = learner,
  resampling = resampling,
  measure = measure,
  search_space = search_space,
  terminator = terminator)

# Load tuner
tuner = tnr("grid_search", resolution = 5)

# Trigger optimization
tuner$optimize(instance)

# View results
instance$result

Resources

Further documentation can be found in the mlr3book and the mlr3tuning cheatsheet. Tutorials are available in the mlr3gallery.

Links

  • Download from CRAN at
    https://​cloud.r-project.org/​package=mlr3tuning
  • Browse source code at
    https://​github.com/​mlr-org/​mlr3tuning/​
  • Report a bug at
    https://​github.com/​mlr-org/​mlr3tuning/​issues

License

  • LGPL-3

Developers

  • Marc Becker
    Maintainer, author
  • Michel Lang
    Author
  • Jakob Richter
    Author
  • Bernd Bischl
    Author
  • Daniel Schalk
    Author

Developed by Marc Becker, Michel Lang, Jakob Richter, Bernd Bischl, Daniel Schalk.

Site built with pkgdown 1.6.1.