Medial Code Documentation
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
xgboost.core Namespace Reference

Data Structures

class  _ProxyDMatrix
 
class  Booster
 
class  DataIter
 
class  DataSplitMode
 
class  DeviceQuantileDMatrix
 
class  DMatrix
 
class  QuantileDMatrix
 
class  XGBoostError
 

Functions

bytes from_pystr_to_cstr (str data)
 
ctypes.Array from_pystr_to_cstr (List[str] data)
 
Union[bytes, ctypes.Array] from_pystr_to_cstr (Union[str, List[str]] data)
 
List[str] from_cstr_to_pystr (CStrPptr data, c_bst_ulong length)
 
bytes make_jcargs (**Any kwargs)
 
List[Tuple[str, float]] _parse_eval_str (str result)
 
str _expect (Sequence[Type] expectations, Type got)
 
None _log_callback (bytes msg)
 
Callable _get_log_callback_func ()
 
Tuple[int, int, int] _lib_version (ctypes.CDLL lib)
 
str _py_version ()
 
ctypes.CDLL _load_lib ()
 
None _check_call (int ret)
 
None _check_distributed_params (Dict[str, Any] kwargs)
 
List[str] _validate_feature_info (Sequence[str] feature_info, int n_features, str name)
 
dict build_info ()
 
Type[CNumeric] _numpy2ctypes_type (Type[np.number] dtype)
 
bytes _cuda_array_interface (DataType data)
 
np.ndarray ctypes2numpy (CNumericPtr cptr, int length, Type[np.number] dtype)
 
CupyT ctypes2cupy (CNumericPtr cptr, int length, Type[np.number] dtype)
 
bytearray ctypes2buffer (CStrPtr cptr, int length)
 
ctypes.c_char_p c_str (str string)
 
Union[ctypes.Array, ctypes._Pointer] c_array (Type[CTypeT] ctype, ArrayLike values)
 
NumpyOrCupy from_array_interface (dict interface)
 
NumpyOrCupy _prediction_output (CNumericPtr shape, c_bst_ulong dims, CFloatPtr predts, bool is_cuda)
 
Callable[[Callable[..., _T]], Callable[..., _T]] require_keyword_args (bool error)
 
BoosterParam _configure_metrics (BoosterParam params)
 

Variables

 IterRange = TypeVar("IterRange", Optional[Tuple[int, int]], Tuple[int, int])
 
ctypes.CDLL _LIB = _load_lib()
 
Callable[[Callable[..., _T]], Callable[..., _T]] _deprecate_positional_args = require_keyword_args(False)
 
 Objective = Callable[[np.ndarray, DMatrix], Tuple[np.ndarray, np.ndarray]]
 
 Metric = Callable[[np.ndarray, DMatrix], Tuple[str, float]]
 
 _interface
 

Detailed Description

Core XGBoost Library.

Function Documentation

◆ _check_call()

None xgboost.core._check_call ( int  ret)
protected
Check the return value of C API call

This function will raise exception when error occurs.
Wrap every API call with this function

Parameters
----------
ret :
    return value from API calls

◆ _check_distributed_params()

None xgboost.core._check_distributed_params ( Dict[str, Any]  kwargs)
protected
Validate parameters in distributed environments.

◆ _expect()

str xgboost.core._expect ( Sequence[Type]  expectations,
Type  got 
)
protected
Translate input error into string.

Parameters
----------
expectations :
    a list of expected value.
got :
    actual input

Returns
-------
msg: str

◆ _get_log_callback_func()

Callable xgboost.core._get_log_callback_func ( )
protected
Wrap log_callback() method in ctypes callback type

◆ _lib_version()

Tuple[int, int, int] xgboost.core._lib_version ( ctypes.CDLL  lib)
protected
Get the XGBoost version from native shared object.

◆ _load_lib()

ctypes.CDLL xgboost.core._load_lib ( )
protected
Load xgboost Library.

◆ _log_callback()

None xgboost.core._log_callback ( bytes  msg)
protected
Redirect logs from native library into Python console

◆ _parse_eval_str()

List[Tuple[str, float]] xgboost.core._parse_eval_str ( str  result)
protected
Parse an eval result string from the booster.

◆ _py_version()

str xgboost.core._py_version ( )
protected
Get the XGBoost version from Python version file.

◆ build_info()

dict xgboost.core.build_info ( )
Build information of XGBoost.  The returned value format is not stable. Also,
please note that build time dependency is not the same as runtime dependency. For
instance, it's possible to build XGBoost with older CUDA version but run it with the
lastest one.

  .. versionadded:: 1.6.0

◆ c_array()

Union[ctypes.Array, ctypes._Pointer] xgboost.core.c_array ( Type[CTypeT]  ctype,
ArrayLike   values 
)
Convert a python array to c array.

◆ c_str()

ctypes.c_char_p xgboost.core.c_str ( str  string)
Convert a python string to cstring.

◆ ctypes2buffer()

bytearray xgboost.core.ctypes2buffer ( CStrPtr  cptr,
int  length 
)
Convert ctypes pointer to buffer type.

◆ ctypes2cupy()

CupyT xgboost.core.ctypes2cupy ( CNumericPtr  cptr,
int  length,
Type[np.number]  dtype 
)
Convert a ctypes pointer array to a cupy array.

◆ ctypes2numpy()

np.ndarray xgboost.core.ctypes2numpy ( CNumericPtr  cptr,
int  length,
Type[np.number]  dtype 
)
Convert a ctypes pointer array to a numpy array.

◆ from_array_interface()

NumpyOrCupy xgboost.core.from_array_interface ( dict  interface)
Convert array interface to numpy or cupy array

◆ from_cstr_to_pystr()

List[str] xgboost.core.from_cstr_to_pystr ( CStrPptr  data,
c_bst_ulong  length 
)
Revert C pointer to Python str

Parameters
----------
data :
    pointer to data
length :
    pointer to length of data

◆ from_pystr_to_cstr()

Union[bytes, ctypes.Array] xgboost.core.from_pystr_to_cstr ( Union[str, List[str]]  data)
Convert a Python str or list of Python str to C pointer

Parameters
----------
data
    str or list of str

◆ require_keyword_args()

Callable[[Callable[..., _T]], Callable[..., _T]] xgboost.core.require_keyword_args ( bool  error)
Decorator for methods that issues warnings for positional arguments

Using the keyword-only argument syntax in pep 3102, arguments after the
* will issue a warning or error when passed as a positional argument.

Modified from sklearn utils.validation.

Parameters
----------
error :
    Whether to throw an error or raise a warning.