| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/xgb.Booster.R |
| 3 |
\name{xgb.config} |
| 4 |
\alias{xgb.config} |
| 5 |
\alias{xgb.config<-} |
| 6 |
\title{Accessors for model parameters as JSON string} |
| 7 |
\usage{ |
| 8 |
xgb.config(object) |
| 9 |
|
| 10 |
xgb.config(object) <- value |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{object}{Object of class \code{xgb.Booster}.\strong{Will be modified in-place} when assigning to it.} |
| 14 |
|
| 15 |
\item{value}{A list.} |
| 16 |
} |
| 17 |
\value{ |
| 18 |
Parameters as a list. |
| 19 |
} |
| 20 |
\description{ |
| 21 |
Accessors for model parameters as JSON string |
| 22 |
} |
| 23 |
\details{ |
| 24 |
Note that assignment is performed in-place on the booster C object, which unlike assignment |
| 25 |
of R attributes, doesn't follow typical copy-on-write semantics for assignment - i.e. all references |
| 26 |
to the same booster will also get updated. |
| 27 |
|
| 28 |
See \code{\link[=xgb.copy.Booster]{xgb.copy.Booster()}} for an example of this behavior. |
| 29 |
} |
| 30 |
\examples{ |
| 31 |
data(agaricus.train, package = "xgboost") |
| 32 |
|
| 33 |
## Keep the number of threads to 1 for examples |
| 34 |
nthread <- 1 |
| 35 |
data.table::setDTthreads(nthread) |
| 36 |
train <- agaricus.train |
| 37 |
|
| 38 |
bst <- xgb.train( |
| 39 |
data = xgb.DMatrix(train$data, label = train$label, nthread = 1), |
| 40 |
nrounds = 2, |
| 41 |
params = xgb.params( |
| 42 |
max_depth = 2, |
| 43 |
nthread = nthread, |
| 44 |
objective = "binary:logistic" |
| 45 |
) |
| 46 |
) |
| 47 |
|
| 48 |
config <- xgb.config(bst) |
| 49 |
|
| 50 |
} |