+
Skip to content

xgboost with early_stopping_rounds set not working with preprocessing in pipeline #1337

Open
@fionaewald

Description

@fionaewald

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)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载