Medial Code Documentation
|
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 | |
Core XGBoost Library.
|
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
|
protected |
Validate parameters in distributed environments.
|
protected |
Translate input error into string. Parameters ---------- expectations : a list of expected value. got : actual input Returns ------- msg: str
|
protected |
Wrap log_callback() method in ctypes callback type
|
protected |
Get the XGBoost version from native shared object.
|
protected |
Load xgboost Library.
|
protected |
Redirect logs from native library into Python console
|
protected |
Parse an eval result string from the booster.
|
protected |
Get the XGBoost version from Python version file.
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
Union[ctypes.Array, ctypes._Pointer] xgboost.core.c_array | ( | Type[CTypeT] | ctype, |
ArrayLike | values | ||
) |
Convert a python array to c array.
ctypes.c_char_p xgboost.core.c_str | ( | str | string | ) |
Convert a python string to cstring.
bytearray xgboost.core.ctypes2buffer | ( | CStrPtr | cptr, |
int | length | ||
) |
Convert ctypes pointer to buffer type.
CupyT xgboost.core.ctypes2cupy | ( | CNumericPtr | cptr, |
int | length, | ||
Type[np.number] | dtype | ||
) |
Convert a ctypes pointer array to a cupy array.
np.ndarray xgboost.core.ctypes2numpy | ( | CNumericPtr | cptr, |
int | length, | ||
Type[np.number] | dtype | ||
) |
Convert a ctypes pointer array to a numpy array.
NumpyOrCupy xgboost.core.from_array_interface | ( | dict | interface | ) |
Convert array interface to numpy or cupy array
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
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
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.