mlr-org / mlr3hyperband

Successive Halving and Hyperband in the mlr3 ecosystem
https://mlr3hyperband.mlr-org.com
GNU Lesser General Public License v3.0
18 stars 5 forks source link

Examples don´t work #52

Closed ThomasWolf0701 closed 4 years ago

ThomasWolf0701 commented 4 years ago

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)

ThomasWolf0701 commented 4 years ago

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)

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

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