Open mb706 opened 10 months ago
Hello! I'm encountering an issue when trying to use PipeOpMice from the NADIA package. When running the following example code, I receive an error.
library(NADIA) library(mlr3oml) task <- mlr3oml::OMLTask$new(55) task <- task$task graph <- PipeOpMice$new()%>>% PipeOpEncodeImpact$new() %>>% lrn('classif.glmnet') Error in isTRUE(lhs) : 找不到对象'ParamDbl'
Thank you for any assistance you can provide! The error seems related to the ParamDbl object, but I'm not sure if there's a specific configuration or setup required to resolve this. Any suggestions would be greatly appreciated.
We are in the process of overhauling the
paradox
package, on which yourNADIA
package depends: At some point in the near future, we are going to merge this PR.This will remove the
ParamDbl
,ParamInt
etc. classes, instead only theParamSet
class will remain, representing the parameter space as a table. Constructing aParamSet
will then need to be done using the shorthand formsps()
,p_dbl()
,p_int()
etc. See this diff of PipeOpImputeOOR.R inmlr3pipelines
as an example of what changes are necessary.Note that
ps()
,p_dbl()
etc. is already possible (and the recommended way of doing this!), we are just phasing out the oldParamDbl$new()
way.If it helps, I did this semi-automatically by running the following in the R directory of affected packages. Please check these commands before running them and check the result, I can't guarantee that it works as intended in your setup.
It is not perfect -- it e.g. fails when the closing parentheses of the
ParamSet$new(params = list(
are not on the same line (i.e. they are not))
), so I had to do some manual cleaning afterwards.Some other changes could also be necessary: Instead of accessing
param_set$params[["<id>"]]$<field>
, it is now necessary to accessparam_set$<field>[["<id>"]]
. Both of these were possible in the past, we are phasing out the first one now.Please @ me if you have any questions, I will try to help.