| xgb.set.config, xgb.get.config | R Documentation |
Global configuration consists of a collection of parameters that can be applied in the global
scope. See https://xgboost.readthedocs.io/en/stable/parameter.html for the full list of
parameters supported in the global configuration. Use xgb.set.config() to update the
values of one or more global-scope parameters. Use xgb.get.config() to fetch the current
values of all global-scope parameters (listed in
https://xgboost.readthedocs.io/en/stable/parameter.html).
xgb.set.config(...)
xgb.get.config()
... |
List of parameters to be set, as keyword arguments |
Note that serialization-related functions might use a globally-configured number of threads,
which is managed by the system's OpenMP (OMP) configuration instead. Typically, XGBoost methods
accept an nthreads parameter, but some methods like readRDS() might get executed before such
parameter can be supplied.
The number of OMP threads can in turn be configured for example through an environment variable
OMP_NUM_THREADS (needs to be set before R is started), or through RhpcBLASctl::omp_set_num_threads.
xgb.set.config() returns TRUE to signal success. xgb.get.config() returns
a list containing all global-scope parameters and their values.
# Set verbosity level to silent (0)
xgb.set.config(verbosity = 0)
# Now global verbosity level is 0
config <- xgb.get.config()
print(config$verbosity)
# Set verbosity level to warning (1)
xgb.set.config(verbosity = 1)
# Now global verbosity level is 1
config <- xgb.get.config()
print(config$verbosity)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.