mlr-org/mlr3hyperband

Examples don´t work

Closed this issue · 1 comments

I ran the example from the package as seen below and got the following error:

tuner$tune(inst)
Fehler: Versuch eine Nicht-Funktion anzuwenden

return the best evaluation

inst$best()
Fehler: Versuch eine Nicht-Funktion anzuwenden

print all evaluations

print(inst$archive())
Fehler in print(inst$archive()) : Versuch eine Nicht-Funktion anzuwenden

print layout of the brackets

print(tuner$info)
NULL

library(mlr3hyperband)
library(mlr3learners)
library(mlr3tuning)
library(mlr3)
library(paradox)

set.seed(123)

define hyperparameter and budget parameter for tuning with hyperband

params = list(
ParamInt$new("nrounds", lower = 1, upper = 16, tag = "budget"),
ParamDbl$new("eta", lower = 0, upper = 1),
ParamFct$new("booster", levels = c("gbtree", "gblinear", "dart"))
)

inst = TuningInstance$new(
tsk("iris"),
lrn("classif.xgboost"),
rsmp("holdout"),
msr("classif.ce"),
ParamSet$new(params),
term("evals", n_evals = 100000)
)

create custom sampler (optional):

- beta distribution with alpha = 2 and beta = 5

- categorical distribution with custom probabilities

sampler = SamplerJointIndep$new(list(
Sampler1DRfun$new(params[[2]], function(n) rbeta(n, 2, 5)),
Sampler1DCateg$new(params[[3]], prob = c(0.2, 0.3, 0.5))
))

tuner = TunerHyperband$new(eta = 2L, sampler = sampler)

Not run:

tuner$tune(inst)

Here is the installation I did

remotes::install_github("mlr-org/mlr3hyperband",force = TRUE)
Downloading GitHub repo mlr-org/mlr3hyperband@master
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools custom from https://cran.r-project.org/bin/windows/Rtools/.
√ checking for file 'C:\Users\Thomas Wolf\AppData\Local\Temp\RtmpA1A2bR\remotes511866dffae\mlr-org-mlr3hyperband-c1e36d4/DESCRIPTION' (572ms)

  • preparing 'mlr3hyperband':
    √ checking DESCRIPTION meta-information ...
  • installing the package to process help pages
  • saving partial Rd database (4.6s)
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building 'mlr3hyperband_0.0.0.9000.tar.gz'

Installing package into ‘C:/Users/Thomas Wolf/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

  • installing source package 'mlr3hyperband' ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    converting help for package 'mlr3hyperband'
    finding HTML links ... fertig
    TunerHyperband html
    finding level-2 HTML links ... done

Rd warning: C:/Users/Thomas Wolf/AppData/Local/Temp/Rtmp6prsZt/Rbuild27607594528/mlr3hyperband/man/TunerHyperband.Rd:30: missing file link 'Terminator'
Rd warning: C:/Users/Thomas Wolf/AppData/Local/Temp/Rtmp6prsZt/Rbuild27607594528/mlr3hyperband/man/TunerHyperband.Rd:133: file link 'PipeOpSubsample' in package 'mlr3pipelines' does not exist and so has been treated as a topic
Rd warning: C:/Users/Thomas Wolf/AppData/Local/Temp/Rtmp6prsZt/Rbuild27607594528/mlr3hyperband/man/TunerHyperband.Rd:134: file link 'GraphLearner' in package 'mlr3pipelines' does not exist and so has been treated as a topic
mlr3hyperband-package html
nds_selection html
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path

  • DONE (mlr3hyperband)