xgboost
Typedefs | Functions
Library

Typedefs

typedef void * DMatrixHandle
 Handle to the DMatrix. More...
 
typedef void * BoosterHandle
 Handle to the Booster. More...
 
typedef void * CategoriesHandle
 Handle to the categories container. More...
 

Functions

void XGBoostVersion (int *major, int *minor, int *patch)
 Return the version of the XGBoost library. More...
 
int XGBuildInfo (char const **out)
 Get compile information of the shared XGBoost library. More...
 
const char * XGBGetLastError ()
 Get the string message of the last error. More...
 
int XGBRegisterLogCallback (void(*callback)(const char *))
 register callback function for LOG(INFO) messages – helpful messages that are not errors. More...
 
int XGBSetGlobalConfig (char const *config)
 Set global configuration (collection of parameters that apply globally). This function accepts the list of key-value pairs representing the global-scope parameters to be configured. The list of key-value pairs are passed in as a JSON string. More...
 
int XGBGetGlobalConfig (char const **out_config)
 Get current global configuration (collection of parameters that apply globally). More...
 

Detailed Description

These functions are used to obtain general information about XGBoost including version, build info and current global configuration.

Typedef Documentation

◆ BoosterHandle

typedef void* BoosterHandle

Handle to the Booster.

◆ CategoriesHandle

typedef void* CategoriesHandle

Handle to the categories container.

Since
3.2.0

◆ DMatrixHandle

typedef void* DMatrixHandle

Handle to the DMatrix.

Function Documentation

◆ XGBGetGlobalConfig()

int XGBGetGlobalConfig ( char const **  out_config)

Get current global configuration (collection of parameters that apply globally).

Parameters
out_configpointer to received returned global configuration, represented as a JSON string.
Returns
0 when success, -1 when failure happens

◆ XGBGetLastError()

const char* XGBGetLastError ( )

Get the string message of the last error.

Most functions in XGBoost returns 0 when success and non-zero when an error occurred. In the case of error, XGBGetLastError can be used to retrieve the error message

This function is thread safe.

Returns
The error message from the last error.

◆ XGBoostVersion()

void XGBoostVersion ( int *  major,
int *  minor,
int *  patch 
)

Return the version of the XGBoost library.

The output variable is only written if it's not NULL.

Parameters
majorStore the major version number.
minorStore the minor version number.
patchStore the patch (revision) number.

◆ XGBRegisterLogCallback()

int XGBRegisterLogCallback ( void(*)(const char *)  callback)

register callback function for LOG(INFO) messages – helpful messages that are not errors.

Note
This function can be called by multiple threads. The callback function will run on the thread that registered it.
Returns
0 when success, -1 when failure happens

◆ XGBSetGlobalConfig()

int XGBSetGlobalConfig ( char const *  config)

Set global configuration (collection of parameters that apply globally). This function accepts the list of key-value pairs representing the global-scope parameters to be configured. The list of key-value pairs are passed in as a JSON string.

Parameters
configa JSON string representing the list of key-value pairs. The JSON object shall be flat: no value can be a JSON object or an array.
Returns
0 when success, -1 when failure happens

◆ XGBuildInfo()

int XGBuildInfo ( char const **  out)

Get compile information of the shared XGBoost library.

Parameters
outstring encoded JSON object containing build flags and dependency versions.
Returns
0 when success, -1 when failure happens