DoubleML / doubleml-for-r

DoubleML - Double Machine Learning in R
https://docs.doubleml.org
Other
135 stars 25 forks source link

[Bug]: Tuning with default `tune_settings` fails #155

Closed MalteKurz closed 2 years ago

MalteKurz commented 2 years ago

Describe the bug

Tuning with default tune_settings fails. Typo in https://github.com/DoubleML/doubleml-for-r/blob/acb9d46ee7eece72efff61e6cdc089c69696572b/R/double_ml.R#L774

Minimum reproducible code snippet

library(DoubleML)
library(mlr3)
library(mlr3learners)
library(data.table)
set.seed(2)
ml_g = lrn("regr.ranger", num.trees = 10, max.depth = 2)
ml_m = ml_g$clone()
obj_dml_data = make_plr_CCDDHNR2018(alpha = 0.5)
dml_plr_obj = DoubleMLPLR$new(obj_dml_data, ml_g, ml_m)
par_grids = list("ml_g" = paradox::ParamSet$new(list(
    paradox::ParamInt$new("num.trees", lower = 1, upper = 10, default = 5))),
    "ml_m" = paradox::ParamSet$new(list(
    paradox::ParamInt$new("num.trees", lower = 1, upper = 10, default = 5))))

dml_plr_obj$tune(param_set=par_grids)

Expected Result

No exception

Actual Result

Exception

 Error in loadNamespace(name) : there is no package called ‘mlr3tunin’ 

Versions

> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 21.10

> packageVersion('DoubleML')
[1] ‘0.4.1’
> packageVersion('mlr3')
[1] ‘0.11.0.9000’