Medial Code Documentation
|
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 |
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.
|
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.
|
inline |
Push batch of data for Quantile DMatrix support.
batch | Input data wrapped inside a adapter batch. |
gmat | The row-major histogram index that contains index for ALL data. |
base_rowid | The beginning row index for current batch. |