Open mb706 opened 3 years ago
@berndbischl
What bug is the workaround for?
This one: https://github.com/mlr-org/mlr3/issues/581
The "workaround" is having the function object inherit the class "function", so it is arguable if that is maybe the way it is supposed to be.
hi martin, thx a lot for taking the time to look at this. but.... you are kinda making it harder than it should be to review this?
1) FunctionParamValue is essential and not explained
2) The code in ParamSet you added is complicated enough to warrant comments
3) Where in the calling code is "env" passed? Thats essential. I think you must have done this already in a branch / locally? Because your example already works. This must be reviewed too.
4) Pls show an example with resampling and using "n" somewhere, maybe with minsplit. Which n is taken? exactly the size of the training set?
Furthermore, maybe not essential now (If this works we should REALLY try to use it), but: I don't think we make (even an experienced user) write this: trafo = function(x) FunctionParamValue(function(env)
probably some sugar / shortcut might be needed?
See how mtry as the Learner sees it is
3
, derived from its$values$mtry
, which iswith
x
set to 0.78.task
is, by default, taken from the environment in which theLearner
callsself$param_set$get_values(tags = "train")
.I am not yet completely happy with this solution:
dynGet()
, or the like.Some problems that arose: what should the behaviour of
ParamSetCollection$get_valuess()
be when the context is not fulfilled?PSC$get_values()
just not be called?