You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @wyfwps! Can you please copy your code, run reprex::reprex(), and then copy-paste the result in the above post? Would be helpful to add the library versions as well with devtools::session_info(). The last line has a taks instead of task, maybe that's the problem?
Run the codes as below, the error came as "Error in assert_class(task, "Task", .var.name = .var.name) : argument "task" is missing, with no default"
library(tidyverse)
library(mlr3verse)
boston = tsk("boston_housing")
str(boston$data())
prep = po("encode", method = "treatment",
affect_columns = selector_name("chas")) %>>%
po("encodeimpact",
affect_columns = selector_name("town"))
boston = prep$train(boston)[[1]]
set.seed(123)
split = partition(boston, ratio = 0.8)
learner = lrn("regr.glmnet", alpha = 0) # 需要 glmnet 包
search_space = ps(
s = p_dbl(lower = 0.001, upper = 2))
at = auto_tuner(
tuner = tnr("random_search"),
learner = learner,
resampling = rsmp("cv", folds = 3L), # 3 折交叉验证
measure = msr("regr.rmse"), # 评估指标选 rmse
search_space = search_space,
term_evals = 10) # 计算 10 次终止
set.seed(123)
at$train(boston, row_ids = split$train)
learner$param_set$values =
at$tuning_result$learner_param_vals[[1]]
learner$train(boston, row_ids = split$train)
autoplot(learner,taks=boston)
The text was updated successfully, but these errors were encountered: