Search code examples
rmlr3

"cannot add bindings to a locked environment" when creating AutoTuner in mlr3


i have error message when I run code from mlr Manual.

library(mlr3)

task = mlr_tasks$get("iris")
learner = mlr_learners$get("classif.rpart")
resampling = mlr_resamplings$get("holdout")
measures = mlr_measures$mget("classif.ce")
param_set = paradox::ParamSet$new(
  params = list(paradox::ParamDbl$new("cp", lower = 0.001, upper = 0.1)))
terminator = mlr3tuning::TerminatorEvaluations$new(5)

at = mlr3tuning::AutoTuner$new(learner, resampling, measures = measures, param_set, terminator,
                               tuner = mlr3tuning::TunerGridSearch)

Output message: Error in self$data$tuner_generator = tuner : cannot add bindings to a locked environment

Is this problem with my local setting or just issue in mlr3tuning?


My setup: Microsoft R Open 3.5.3 The enhanced R distribution from Microsoft Microsoft packages Copyright (C) 2019 Microsoft Corporation

Using the Intel MKL for parallel mathematical computing (using 6 cores).

R version 3.5.3 (2019-03-11) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18362)


Solution

  • mlr3 is still very new and in active development, so from time to time things will break like this. Should be fixed soon.

    To be clear, this isn't an issue with your local settings.

    Update: The start page of the book now displays the versions of the mlr3 packages that it was successfully built with. If something breaks, copy and paste the command at the bottom of the page to install the package versions that work.