mlr3tuning v0.5.0

0

Monthly downloads

0th

Percentile

Tuning for 'mlr3'

Implements methods for hyperparameter tuning with 'mlr3', e.g. Grid Search, Random Search, or Simulated Annealing. Various termination criteria can be set and combined. The class 'AutoTuner' provides a convenient way to perform nested resampling in combination with 'mlr3'.

Readme

mlr3tuning

Package website: release | dev

tic CRAN Status StackOverflow Mattermost CodeFactor

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,
  terminator = terminator,
  search_space = search_space)

# 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.

Functions in mlr3tuning

Name Description
ArchiveTuning Logging object for objective function evaluations
TuningInstanceSingleCrit Single Criterion Tuning Instance
Tuner Tuner
mlr_tuners_cmaes TunerCmaes
mlr3tuning-package mlr3tuning: Tuning for 'mlr3'
TuningInstanceMultiCrit Multi Criteria Tuning Instance
AutoTuner AutoTuner
mlr_tuners Dictionary of Tuners
ObjectiveTuning ObjectiveTuning
TunerFromOptimizer TunerFromOptimizer
tnr Syntactic Sugar for Tuner Construction
reexports Objects exported from other packages
mlr_tuners_random_search TunerRandomSearch
mlr_tuners_nloptr TuneNLoptr
mlr_tuners_grid_search TunerGridSearch
mlr_tuners_gensa TunerGenSA
mlr_tuners_design_points TunerDesignPoints
No Results!

Last month downloads

Details

License LGPL-3
URL https://mlr3tuning.mlr-org.com, https://github.com/mlr-org/mlr3tuning
BugReports https://github.com/mlr-org/mlr3tuning/issues
Encoding UTF-8
NeedsCompilation no
Config/testthat/edition 3
Config/testthat/parallel true
RoxygenNote 7.1.1
Collate 'ArchiveTuning.R' 'AutoTuner.R' 'ObjectiveTuning.R' 'mlr_tuners.R' 'Tuner.R' 'TunerCmaes.R' 'TunerDesignPoints.R' 'TunerFromOptimizer.R' 'TunerGenSA.R' 'TunerGridSearch.R' 'TunerNLoptr.R' 'TunerRandomSearch.R' 'TuningInstanceMulticrit.R' 'TuningInstanceSingleCrit.R' 'assertions.R' 'bibentries.R' 'helper.R' 'reexport.R' 'sugar.R' 'zzz.R'
Packaged 2020-12-07 20:49:36 UTC; marc
Repository CRAN
Date/Publication 2020-12-07 21:50:02 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/mlr3tuning)](http://www.rdocumentation.org/packages/mlr3tuning)