Debian Codegraph @

man/xgb.model.parameters.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/xgb.Booster.R
3 \name{xgb.model.parameters<-}
4 \alias{xgb.model.parameters<-}
5 \title{Accessors for model parameters}
6 \usage{
7 xgb.model.parameters(object) <- value
8 }
9 \arguments{
10 \item{object}{Object of class \code{xgb.Booster}. \strong{Will be modified in-place}.}
11
12 \item{value}{A list (or an object coercible to a list) with the names of parameters to set
13 and the elements corresponding to parameter values.}
14 }
15 \value{
16 The same booster \code{object}, which gets modified in-place.
17 }
18 \description{
19 Only the setter for XGBoost parameters is currently implemented.
20 }
21 \details{
22 Just like \code{\link[=xgb.attr]{xgb.attr()}}, this function will make in-place modifications
23 on the booster object which do not follow typical R assignment semantics - that is,
24 all references to the same booster will also be updated, unlike assingment of R
25 attributes which follow copy-on-write semantics.
26
27 See \code{\link[=xgb.copy.Booster]{xgb.copy.Booster()}} for an example of this behavior.
28
29 Be aware that setting parameters of a fitted booster related to training continuation / updates
30 will reset its number of rounds indicator to zero.
31 }
32 \examples{
33 data(agaricus.train, package = "xgboost")
34
35 train <- agaricus.train
36
37 bst <- xgb.train(
38 data = xgb.DMatrix(train$data, label = train$label, nthread = 1),
39 nrounds = 2,
40 params = xgb.params(
41 max_depth = 2,
42 learning_rate = 1,
43 nthread = 2,
44 objective = "binary:logistic"
45 )
46 )
47
48 xgb.model.parameters(bst) <- list(learning_rate = 0.1)
49
50 }