Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
xgboost.data::SimpleDMatrix Class Reference
Inheritance diagram for xgboost.data::SimpleDMatrix:
xgboost.core.DMatrix

Public Member Functions

template<typename AdapterT >
 SimpleDMatrix (AdapterT *adapter, float missing, int nthread, DataSplitMode data_split_mode=DataSplitMode::kRow)
 
 SimpleDMatrix (dmlc::Stream *in_stream)
 
void SaveToLocalFile (const std::string &fname)
 
MetaInfoInfo () override
 
const MetaInfoInfo () const override
 
Context const * Ctx () const override
 
bool SingleColBlock () const override
 
DMatrixSlice (common::Span< int32_t const > ridxs) override
 
DMatrixSliceCol (int num_slices, int slice_id) override
 
template<>
 SimpleDMatrix (RecordBatchesIterAdapter *adapter, float missing, int nthread, DataSplitMode data_split_mode)
 
- Public Member Functions inherited from xgboost.core.DMatrix
None __init__ (self, DataType data, Optional[ArrayLike] label=None, *Optional[ArrayLike] weight=None, Optional[ArrayLike] base_margin=None, Optional[float] missing=None, bool silent=False, Optional[FeatureNames] feature_names=None, Optional[FeatureTypes] feature_types=None, Optional[int] nthread=None, Optional[ArrayLike] group=None, Optional[ArrayLike] qid=None, Optional[ArrayLike] label_lower_bound=None, Optional[ArrayLike] label_upper_bound=None, Optional[ArrayLike] feature_weights=None, bool enable_categorical=False, DataSplitMode data_split_mode=DataSplitMode.ROW)
 
None __del__ (self)
 
None set_info (self, *Optional[ArrayLike] label=None, Optional[ArrayLike] weight=None, Optional[ArrayLike] base_margin=None, Optional[ArrayLike] group=None, Optional[ArrayLike] qid=None, Optional[ArrayLike] label_lower_bound=None, Optional[ArrayLike] label_upper_bound=None, Optional[FeatureNames] feature_names=None, Optional[FeatureTypes] feature_types=None, Optional[ArrayLike] feature_weights=None)
 
np.ndarray get_float_info (self, str field)
 
np.ndarray get_uint_info (self, str field)
 
None set_float_info (self, str field, ArrayLike data)
 
None set_float_info_npy2d (self, str field, ArrayLike data)
 
None set_uint_info (self, str field, ArrayLike data)
 
None save_binary (self, Union[str, os.PathLike] fname, bool silent=True)
 
None set_label (self, ArrayLike label)
 
None set_weight (self, ArrayLike weight)
 
None set_base_margin (self, ArrayLike margin)
 
None set_group (self, ArrayLike group)
 
np.ndarray get_label (self)
 
np.ndarray get_weight (self)
 
np.ndarray get_base_margin (self)
 
np.ndarray get_group (self)
 
scipy.sparse.csr_matrix get_data (self)
 
Tuple[np.ndarray, np.ndarray] get_quantile_cut (self)
 
int num_row (self)
 
int num_col (self)
 
int num_nonmissing (self)
 
"DMatrix" slice (self, Union[List[int], np.ndarray] rindex, bool allow_groups=False)
 
Optional[FeatureNames] feature_names (self)
 
None feature_names (self, Optional[FeatureNames] feature_names)
 
Optional[FeatureTypes] feature_types (self)
 
None feature_types (self, Optional[FeatureTypes] feature_types)
 

Static Public Attributes

static const int kMagic = 0xffffab01
 magic number used to identify SimpleDMatrix binary files
 

Protected Member Functions

BatchSet< SparsePageGetRowBatches () override
 
BatchSet< CSCPageGetColumnBatches (Context const *ctx) override
 
BatchSet< SortedCSCPageGetSortedColumnBatches (Context const *ctx) override
 
BatchSet< EllpackPageGetEllpackBatches (Context const *ctx, const BatchParam &param) override
 
BatchSet< GHistIndexMatrixGetGradientIndex (Context const *ctx, const BatchParam &param) override
 
BatchSet< ExtSparsePageGetExtBatches (Context const *ctx, BatchParam const &param) override
 
bool EllpackExists () const override
 
bool GHistIndexExists () const override
 
bool SparsePageExists () const override
 
void ReindexFeatures (Context const *ctx)
 Reindex the features based on a global view.
 
- Protected Member Functions inherited from xgboost.core.DMatrix
None _init_from_iter (self, DataIter iterator, bool enable_categorical)
 

Protected Attributes

MetaInfo info_
 
std::shared_ptr< SparsePagesparse_page_ = std::make_shared<SparsePage>()
 
std::shared_ptr< CSCPagecolumn_page_ {nullptr}
 
std::shared_ptr< SortedCSCPagesorted_column_page_ {nullptr}
 
std::shared_ptr< EllpackPageellpack_page_ {nullptr}
 
std::shared_ptr< GHistIndexMatrixgradient_index_ {nullptr}
 
BatchParam batch_param_
 

Additional Inherited Members

- Data Fields inherited from xgboost.core.DMatrix
 missing
 
 nthread
 
 silent
 
 handle
 
 feature_names
 
 feature_types
 

Member Function Documentation

◆ ReindexFeatures()

void xgboost.data::SimpleDMatrix::ReindexFeatures ( Context const *  ctx)
protected

Reindex the features based on a global view.

In some cases (e.g. vertical federated learning), features are loaded locally with indices starting from 0. However, all the algorithms assume the features are globally indexed, so we reindex the features based on the offset needed to obtain the global view.


The documentation for this class was generated from the following files: