Only the setter for XGBoost parameters is currently implemented.
Details
Just like xgb.attr()
, this function will make in-place modifications
on the booster object which do not follow typical R assignment semantics - that is,
all references to the same booster will also be updated, unlike assingment of R
attributes which follow copy-on-write semantics.
See xgb.copy.Booster()
for an example of this behavior.
Be aware that setting parameters of a fitted booster related to training continuation / updates will reset its number of rounds indicator to zero.
Examples
data(agaricus.train, package = "xgboost")
train <- agaricus.train
bst <- xgb.train(
data = xgb.DMatrix(train$data, label = train$label, nthread = 1),
nrounds = 2,
params = xgb.params(
max_depth = 2,
learning_rate = 1,
nthread = 2,
objective = "binary:logistic"
)
)
xgb.model.parameters(bst) <- list(learning_rate = 0.1)