Description
If one wants to combine an xgboost learner where early_stopping_rounds is set to some value with a preprocessing pipeline where feature names are changed, the code renders an error. I tried many things, including different settings for "validate" within the xgboost or defining an internal validation task, but I couldn't figure it out.
I also tried out set_validate(graph_simple, validate = 0.1, ids = "regr.xgboost")
(idea from here).
Here's an example code:
`
task = TaskRegr$new(id = "bike", backend = bike, target = "count")
po_encode <- po("select", id = "select_fac", selector = selector_type("factor")) %>>%
po("encode", method = "one-hot", affect_columns = selector_type("factor"))
learner = lrn("regr.xgboost",
max_depth = 7,
eta = 0.01,
nrounds = 1000,
early_stopping_rounds = 20,
validate = 0.1,
lambda = 0
)
graph_simple <- as_learner(po_encode %>>% learner)
graph_simple$train(task)
`