Closed beiwo07 closed 9 months ago
Update: I have restored from mlr3tuning_0.19.2 to mlr3tuning_0.19.0 and the code runs successfully again. It seems the error is related to the update?
Hey, thanks for reporting. Unfortunately, I cannot reproduce the bug with either 0.19.2 or the current main branch. Maybe something went wrong when installing the packages? This code works for me without any problems. The packages are first installed in a clean environment.
renv::init(bare = TRUE)
# restart r
renv::install(c("mlr-org/mlr3proba", "mlr3tuning", "mlr-org/mlr3extralearners", "mlr3", "glmnet"))
library(mlr3proba)
library(mlr3tuning)
library(mlr3extralearners)
library(mlr3)
df = survival::rats2
task= as_task_surv(df, time= "time1", event= "status")
alpha_vals= seq(0,1,0.2)
learner = lrn("surv.cv_glmnet",
alpha= to_tune(c(alpha_vals)))
instance = mlr3tuning::tune(
tuner = tnr("grid_search"),
task = task,
learner = learner,
resampling = rsmp("cv", folds=5),
measure= msr("surv.cindex")
)
Hi there, I have used the same R script to run my survival analysis successfully. But now it shows error message as below. Is this caused by package updates?
Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'as.matrix': non-conformable arguments
Reproducible code:
Session Info: