Medial Code Documentation
Loading...
Searching...
No Matches
Typedefs | Functions
Library

XGBoost C API reference. More...

Typedefs

typedef void * DMatrixHandle
 handle to DMatrix
 
typedef void * BoosterHandle
 handle to Booster
 

Functions

XGB_DLL void XGBoostVersion (int *major, int *minor, int *patch)
 Return the version of the XGBoost library being currently used.
 
XGB_DLL int XGBuildInfo (char const **out)
 Get compile information of shared library.
 
XGB_DLL const char * XGBGetLastError ()
 get string message of the last error
 
XGB_DLL int XGBRegisterLogCallback (void(*callback)(const char *))
 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
 
XGB_DLL 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.
 
XGB_DLL int XGBGetGlobalConfig (char const **out_config)
 Get current global configuration (collection of parameters that apply globally).
 

Detailed Description

XGBoost C API reference.

For the official document page see: XGBoost C Package.

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

Function Documentation

◆ XGBGetGlobalConfig()

XGB_DLL 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 for success, -1 for failure

◆ XGBGetLastError()

XGB_DLL const char * XGBGetLastError ( )

get string message of the last error

all function in this file will return 0 when success and -1 when an error occurred, XGBGetLastError can be called to retrieve the error

this function is thread safe and can be called by different thread

Returns
const char* error information

◆ XGBoostVersion()

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

Return the version of the XGBoost library being currently used.

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()

XGB_DLL 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 for success, -1 for failure

◆ XGBSetGlobalConfig()

XGB_DLL 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 for success, -1 for failure

◆ XGBuildInfo()

XGB_DLL int XGBuildInfo ( char const **  out)

Get compile information of shared library.

Parameters
outstring encoded JSON object containing build flags and dependency version.
Returns
0 for success, -1 for failure