Closed melonki closed 1 year ago
I have found a solution to this problem. It seems that the default values of hyperparameters A could be dropped when assigning values to hyperparameters B. In this case, I need to assign values to both A and B.
ps = list( scale.robust = TRUE, lgb.convert_categorical = TRUE, lgb.objective = "regression", lgb.learning_rate = 0.1, lgb.num_leaves = 63, lgb.max_depth = 6, lgb.min_data_in_leaf = 10, lgb.bagging_fraction = 0.7, lgb.bagging_freq = 4, lgb.feature_fraction = 0.8, lgb.lambda_l1 = 0.5, lgb.lambda_l2 = 0.5, lgb.max_bin = 63 )
Yes, assigning hyperparameter values using ...$values = list(...)
is not recommended becasue of these kinds of problems.
To set multiple hyperparametervalues at once without having to type a lot, paradox now has the $set_values()
function. You could do
graph$param_set$set_values(.values = ps)
or just list all the parameters in the function call directly
graph$param_set$set_values(
scale.robust = TRUE,
lgb.learning_rate = 0.1,
lgb.num_leaves = 63,
...
)
Dear Contributors and Members,
Thank you for your great efforts in developing
mlr3pipelines
! It accelerated my work a lot. However, when I try to rerun the code which I wrote 4 months ago, it doesn't work. The error was "Error in !convert_categorical : invalid argument type This happened PipeOp lgb's $train()", but there was no categorical variable in my dataset at all. I guess the error was caused by the change in the R environment since I have updated several packages. But I don't know how to peek into the graph learner and find the exact cause. Below please find the reproducible example and the environment where I ran the code. PS: the lightgbm package works fine when not incorporated in an mlr3 workflow in my workstation.I would appreciate it if you would provide any suggestions! Thank you in advance for your help!
Best, Melonki