Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
xgboost::GHistIndexMatrix Class Reference

preprocessed global index matrix, in CSR format. More...

#include <gradient_index.h>

Public Member Functions

bst_bin_t MaxNumBinPerFeat () const
 
 GHistIndexMatrix (Context const *ctx, DMatrix *x, bst_bin_t max_bins_per_feat, double sparse_thresh, bool sorted_sketch, common::Span< float const > hess={})
 Constrcutor for SimpleDMatrix.
 
 GHistIndexMatrix (MetaInfo const &info, common::HistogramCuts &&cuts, bst_bin_t max_bin_per_feat)
 Constructor for Iterative DMatrix.
 
 GHistIndexMatrix (Context const *ctx, MetaInfo const &info, EllpackPage const &page, BatchParam const &p)
 Constructor fro Iterative DMatrix where we might copy an existing ellpack page to host gradient index.
 
 GHistIndexMatrix (SparsePage const &page, common::Span< FeatureType const > ft, common::HistogramCuts cuts, int32_t max_bins_per_feat, bool is_dense, double sparse_thresh, int32_t n_threads)
 Constructor for external memory.
 
template<typename Batch >
void PushAdapterBatch (Context const *ctx, size_t rbegin, size_t prev_sum, Batch const &batch, float missing, common::Span< FeatureType const > ft, double sparse_thresh, size_t n_samples_total)
 
template<typename Batch >
void PushAdapterBatchColumns (Context const *ctx, Batch const &batch, float missing, size_t rbegin)
 
void ResizeIndex (const size_t n_index, const bool isDense)
 
void GetFeatureCounts (size_t *counts) const
 
bool IsDense () const
 
void SetDense (bool is_dense)
 
std::size_t RowIdx (size_t ridx) const
 Get the local row index.
 
bst_row_t Size () const
 
bst_feature_t Features () const
 
bool ReadColumnPage (common::AlignedResourceReadStream *fi)
 
std::size_t WriteColumnPage (common::AlignedFileWriteStream *fo) const
 
common::ColumnMatrix const & Transpose () const
 
bst_bin_t GetGindex (size_t ridx, size_t fidx) const
 
float GetFvalue (size_t ridx, size_t fidx, bool is_cat) const
 
float GetFvalue (std::vector< std::uint32_t > const &ptrs, std::vector< float > const &values, std::vector< float > const &mins, bst_row_t ridx, bst_feature_t fidx, bool is_cat) const
 
common::HistogramCutsCuts ()
 
common::HistogramCuts const & Cuts () const
 

Data Fields

common::RefResourceView< std::size_t > row_ptr
 row pointer to rows by element position
 
common::RefResourceView< std::uint8_t > data
 data storage for index.
 
common::Index index
 The histogram index.
 
common::RefResourceView< std::size_t > hit_count
 hit count of each index, used for constructing the ColumnMatrix
 
common::HistogramCuts cut
 The corresponding cuts.
 
bst_bin_t max_numeric_bins_per_feat
 max_bin for each feature.
 
bst_row_t base_rowid {0}
 base row index for current page (used by external memory)
 

Detailed Description

preprocessed global index matrix, in CSR format.

Transform floating values to integer index in histogram This is a global histogram index for CPU histogram. On GPU ellpack page is used.

Constructor & Destructor Documentation

◆ GHistIndexMatrix()

xgboost::GHistIndexMatrix::GHistIndexMatrix ( MetaInfo const &  info,
common::HistogramCuts &&  cuts,
bst_bin_t  max_bin_per_feat 
)

Constructor for Iterative DMatrix.

Initialize basic information and prepare for push batch.


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