MCPcopy Create free account
hub / github.com/dmlc/xgboost / _from_arrow_table

Function _from_arrow_table

python-package/xgboost/data.py:858–880  ·  view source on GitHub ↗
(  # pylint: disable=too-many-positional-arguments
    data: DataType,
    enable_categorical: bool,
    missing: FloatCompatible,
    n_threads: int,
    feature_names: Optional[FeatureNames],
    feature_types: Optional[Union[FeatureTypes, Categories]],
    data_split_mode: DataSplitMode = DataSplitMode.ROW,
)

Source from the content-addressed store, hash-verified

856
857
858def _from_arrow_table( # pylint: disable=too-many-positional-arguments
859 data: DataType,
860 enable_categorical: bool,
861 missing: FloatCompatible,
862 n_threads: int,
863 feature_names: Optional[FeatureNames],
864 feature_types: Optional[Union[FeatureTypes, Categories]],
865 data_split_mode: DataSplitMode = DataSplitMode.ROW,
866) -> DispatchedDataBackendReturnType:
867 df_t, feature_names, feature_types = _transform_arrow_table(
868 data, enable_categorical, feature_names, feature_types
869 )
870 handle = ctypes.c_void_p()
871 _check_call(
872 _LIB.XGDMatrixCreateFromColumnar(
873 df_t.array_interface(),
874 make_jcargs(
875 nthread=n_threads, missing=missing, data_split_mode=data_split_mode
876 ),
877 ctypes.byref(handle),
878 )
879 )
880 return handle, feature_names, feature_types
881
882
883@functools.cache

Callers 1

dispatch_data_backendFunction · 0.85

Calls 4

_transform_arrow_tableFunction · 0.85
_check_callFunction · 0.85
make_jcargsFunction · 0.85
array_interfaceMethod · 0.80

Tested by

no test coverage detected