| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/xgb.config.R |
| 3 |
\name{xgb.set.config, xgb.get.config} |
| 4 |
\alias{xgb.set.config, xgb.get.config} |
| 5 |
\alias{xgb.set.config} |
| 6 |
\alias{xgb.get.config} |
| 7 |
\title{Set and get global configuration} |
| 8 |
\usage{ |
| 9 |
xgb.set.config(...) |
| 10 |
|
| 11 |
xgb.get.config() |
| 12 |
} |
| 13 |
\arguments{ |
| 14 |
\item{...}{List of parameters to be set, as keyword arguments} |
| 15 |
} |
| 16 |
\value{ |
| 17 |
\code{xgb.set.config()} returns \code{TRUE} to signal success. \code{xgb.get.config()} returns |
| 18 |
a list containing all global-scope parameters and their values. |
| 19 |
} |
| 20 |
\description{ |
| 21 |
Global configuration consists of a collection of parameters that can be applied in the global |
| 22 |
scope. See \url{https://xgboost.readthedocs.io/en/stable/parameter.html} for the full list of |
| 23 |
parameters supported in the global configuration. Use \code{xgb.set.config()} to update the |
| 24 |
values of one or more global-scope parameters. Use \code{xgb.get.config()} to fetch the current |
| 25 |
values of all global-scope parameters (listed in |
| 26 |
\url{https://xgboost.readthedocs.io/en/stable/parameter.html}). |
| 27 |
} |
| 28 |
\details{ |
| 29 |
Note that serialization-related functions might use a globally-configured number of threads, |
| 30 |
which is managed by the system's OpenMP (OMP) configuration instead. Typically, XGBoost methods |
| 31 |
accept an \code{nthreads} parameter, but some methods like \code{\link[=readRDS]{readRDS()}} might get executed before such |
| 32 |
parameter can be supplied. |
| 33 |
|
| 34 |
The number of OMP threads can in turn be configured for example through an environment variable |
| 35 |
\code{OMP_NUM_THREADS} (needs to be set before R is started), or through \code{RhpcBLASctl::omp_set_num_threads}. |
| 36 |
} |
| 37 |
\examples{ |
| 38 |
# Set verbosity level to silent (0) |
| 39 |
xgb.set.config(verbosity = 0) |
| 40 |
# Now global verbosity level is 0 |
| 41 |
config <- xgb.get.config() |
| 42 |
print(config$verbosity) |
| 43 |
# Set verbosity level to warning (1) |
| 44 |
xgb.set.config(verbosity = 1) |
| 45 |
# Now global verbosity level is 1 |
| 46 |
config <- xgb.get.config() |
| 47 |
print(config$verbosity) |
| 48 |
} |