xgbTree 上的调整参数不再起作用?
Tuning paramters on xgbTree not working anymore?
这几天,当我尝试使用 caret 和 xgbTree 训练模型时,调整参数已停止工作。在此之前,一切都运行良好。这是我收到的错误:
[16:45:38] WARNING: amalgamation/../src/learner.cc:516:
Parameters: { tune } might not be used.
This may not be accurate due to some parameters are only used in language bindings but
passed down to XGBoost core. Or some parameters are not used but slip through this
verification. Please open an issue if you find above cases.
我的模型是这样的:
set.seed(79647)
xgb <- train(dv ~ .,
data = model_train,
method = "xgbTree",
trControl = ctrl,
tune = expand.grid(max_depth = 3,
nrounds = 50,
eta = 0.4,
min_child_weight = 1,
subsample = 0.8,
gamma = 0,
colsample_bytree = 0.8,
subsample = 1),
metric = "ROC")
我无法弄清楚是什么导致了这个错误,google 搜索错误消息并没有为我提供任何指导。有人对此有一些可能的见解吗?
您在调用中指定了 subsample
两次,而且调整参数应该使用 tuneGrid =
而不是 tune=
送入函数
如果你尝试下面的方法,它应该可以工作,我没有你的 trainControl,所以我使用下面的基本方法:
Grid = expand.grid(nrounds = 50,
max_depth = 2:3,
eta = 0.4,
min_child_weight = 1,
subsample = 0.8,
gamma = 0,
colsample_bytree = 0.8)
xgb <- train(Species ~ .,
data = iris,
method = "xgbTree",
trControl = trainControl(method="cv"),
tuneGrid =Grid)
这几天,当我尝试使用 caret 和 xgbTree 训练模型时,调整参数已停止工作。在此之前,一切都运行良好。这是我收到的错误:
[16:45:38] WARNING: amalgamation/../src/learner.cc:516:
Parameters: { tune } might not be used.
This may not be accurate due to some parameters are only used in language bindings but
passed down to XGBoost core. Or some parameters are not used but slip through this
verification. Please open an issue if you find above cases.
我的模型是这样的:
set.seed(79647)
xgb <- train(dv ~ .,
data = model_train,
method = "xgbTree",
trControl = ctrl,
tune = expand.grid(max_depth = 3,
nrounds = 50,
eta = 0.4,
min_child_weight = 1,
subsample = 0.8,
gamma = 0,
colsample_bytree = 0.8,
subsample = 1),
metric = "ROC")
我无法弄清楚是什么导致了这个错误,google 搜索错误消息并没有为我提供任何指导。有人对此有一些可能的见解吗?
您在调用中指定了 subsample
两次,而且调整参数应该使用 tuneGrid =
而不是 tune=
如果你尝试下面的方法,它应该可以工作,我没有你的 trainControl,所以我使用下面的基本方法:
Grid = expand.grid(nrounds = 50,
max_depth = 2:3,
eta = 0.4,
min_child_weight = 1,
subsample = 0.8,
gamma = 0,
colsample_bytree = 0.8)
xgb <- train(Species ~ .,
data = iris,
method = "xgbTree",
trControl = trainControl(method="cv"),
tuneGrid =Grid)