Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark should work with learner containing TuneToken if it is overwritten by param_values #1226

Open
mb706 opened this issue Dec 8, 2024 · 0 comments

Comments

@mb706
Copy link
Collaborator

mb706 commented Dec 8, 2024

library("mlr3")
library("paradox")
bmg <- benchmark_grid(tsk("iris"), lrn("classif.rpart", cp = to_tune()), rsmp("holdout"), param_values = list(list(list(cp = 1))))
benchmark(bmg)
#> Error: <LearnerClassifRpart:classif.rpart> cannot be trained with TuneToken present in hyperparameter: cp

This error is not necessary, since the cp hyperparameter is overwritten given the param_values:

bmg <- benchmark_grid(tsk("iris"), lrn("classif.rpart"), rsmp("holdout"), param_values = list(list(list(cp = 1))))
benchmark(bmg)$learners$learner[[1]]$param_set$values
#> INFO  [22:49:43.505] [mlr3] Running benchmark with 1 resampling iterations
#> INFO  [22:49:43.520] [mlr3] Applying learner 'classif.rpart' on task 'iris' (iter 1/1)
#> INFO  [22:49:43.546] [mlr3] Finished benchmark
#> $cp
#> [1] 1
#> 
#> $xval
#> [1] 0
#> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant