mlr-org / mlr3tuning

Hyperparameter optimization package of the mlr3 ecosystem
https://mlr3tuning.mlr-org.com/
GNU Lesser General Public License v3.0
55 stars 5 forks source link

TunerGridSearch not found #427

Closed tdhock closed 4 months ago

tdhock commented 4 months ago

hi, I have been using mlr3tuning::TunerGridSearch in a package vignette which is now failing to re-build CRAN checks, https://cran.r-project.org/web/checks/check_results_mlr3resampling.html

In a previous version of mlr3tuning I got the following

> mlr3tuning::TunerGridSearch
<TunerGridSearch> object generator
  Inherits from: <Tuner>
  Public:
    initialize: function () 
    clone: function (deep = FALSE) 
  Private:
    .optimize: function (inst) 
  Parent env: <environment: namespace:mlr3tuning>
  Locked objects: TRUE
  Locked class: FALSE
  Portable: TRUE
> packageVersion("mlr3tuning")
[1] ‘0.19.2’

but now I am getting the following

> mlr3tuning::TunerGridSearch
Erreur : 'TunerGridSearch' n’est un object exporté depuis 'namespace:mlr3tuning'
> packageVersion("mlr3tuning")
[1] ‘1.0.0’

After looking at the new objects available, I guess the solution is to use mlr3tuning::TunerBatchGridSearch instead?

For future updates like this, it would be great if you could do revdep checks, and notify people like me about what changes we should make in our CRAN packages. I see "BREAKING CHANGE: The Tuner class is TunerBatch now" in https://github.com/mlr-org/mlr3tuning/blob/main/NEWS.md#mlr3tuning-100 but it was not obvious what I needed to do to change my package to be compatible. A more useful NEWS item would be: "Sub-classes of Tuner, such as TunerGridSearch, are now called TunerBatchGridSearch"

Thanks

be-marc commented 4 months ago

Hey, sorry for trouble. Please use tnr("grid_search") instead of constructing with TunerBatchGridSearch$new(). Of course we ran a revdep check, but mlr3resampling was not shown. The revdep check made by CRAN did not find the problem either.

be-marc commented 4 months ago

I did find it in the logs. Sorry, I overlooked it. There were a few more packages that were broken.

tdhock commented 4 months ago

ok thanks