Medial Code Documentation
Loading...
Searching...
No Matches
Data Structures | Public Member Functions
xgboost::common::ColumnMatrix Class Reference

Column major matrix for gradient index on CPU. More...

#include <column_matrix.h>

Public Member Functions

bst_feature_t GetNumFeature () const
 
 ColumnMatrix (GHistIndexMatrix const &gmat, double sparse_threshold)
 
void InitFromSparse (SparsePage const &page, const GHistIndexMatrix &gmat, double sparse_threshold, int32_t n_threads)
 Initialize ColumnMatrix from GHistIndexMatrix with reference to the original SparsePage.
 
void InitFromGHist (Context const *ctx, GHistIndexMatrix const &gmat)
 Initialize ColumnMatrix from GHistIndexMatrix without reference to actual data.
 
bool IsInitialized () const
 
template<typename Batch >
void PushBatch (int32_t n_threads, Batch const &batch, float missing, GHistIndexMatrix const &gmat, size_t base_rowid)
 Push batch of data for Quantile DMatrix support.
 
void SetTypeSize (size_t max_bin_per_feat)
 
template<typename BinIdxType >
auto SparseColumn (bst_feature_t fidx, bst_row_t first_row_idx) const
 
template<typename BinIdxType , bool any_missing>
auto DenseColumn (bst_feature_t fidx) const
 
template<typename RowBinIdxT >
void SetIndexNoMissing (bst_row_t base_rowid, RowBinIdxT const *row_index, const size_t n_samples, const size_t n_features, int32_t n_threads)
 
template<typename Batch >
void SetIndexMixedColumns (size_t base_rowid, Batch const &batch, const GHistIndexMatrix &gmat, float missing)
 Set column index for both dense and sparse columns.
 
void SetIndexMixedColumns (const GHistIndexMatrix &gmat)
 Set column index for both dense and sparse columns, but with only GHistMatrix available and requires a search for each bin.
 
BinTypeSize GetTypeSize () const
 
auto GetColumnType (bst_feature_t fidx) const
 
bool AnyMissing () const
 
bool Read (AlignedResourceReadStream *fi, uint32_t const *index_base)
 
std::size_t Write (AlignedFileWriteStream *fo) const
 
MissingIndicator const & Missing () const
 

Detailed Description

Column major matrix for gradient index on CPU.

This matrix contains both dense columns and sparse columns, the type of the column is controlled by the sparse threshold parameter. When the number of missing values in a column is below the threshold it's classified as dense column.

Member Function Documentation

◆ InitFromGHist()

void xgboost::common::ColumnMatrix::InitFromGHist ( Context const *  ctx,
GHistIndexMatrix const &  gmat 
)
inline

Initialize ColumnMatrix from GHistIndexMatrix without reference to actual data.

This function requires a binary search for each bin to get back the feature index for those bins.

◆ PushBatch()

template<typename Batch >
void xgboost::common::ColumnMatrix::PushBatch ( int32_t  n_threads,
Batch const &  batch,
float  missing,
GHistIndexMatrix const &  gmat,
size_t  base_rowid 
)
inline

Push batch of data for Quantile DMatrix support.

Parameters
batchInput data wrapped inside a adapter batch.
gmatThe row-major histogram index that contains index for ALL data.
base_rowidThe beginning row index for current batch.

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