Medial Code Documentation
Loading...
Searching...
No Matches
Data Structures | Namespaces | Typedefs | Enumerations | Functions
hist_util.h File Reference

Copyright 2017-2023 by XGBoost Contributors. More...

#include <algorithm>
#include <cstdint>
#include <limits>
#include <map>
#include <memory>
#include <utility>
#include <vector>
#include "categorical.h"
#include "quantile.h"
#include "row_set.h"
#include "threading_utils.h"
#include "xgboost/base.h"
#include "xgboost/data.h"

Go to the source code of this file.

Data Structures

class  xgboost::common::HistogramCuts
 
class  xgboost::common::Index
 Optionally compressed gradient index. More...
 
struct  xgboost::common::Index::CompressBin< T >
 
class  xgboost::common::HistCollection
 histogram of gradient statistics for multiple nodes More...
 
class  xgboost::common::ParallelGHistBuilder
 Stores temporary histograms to compute them in parallel Supports processing multiple tree-nodes for nested parallelism Able to reduce histograms across threads in efficient way. More...
 

Namespaces

namespace  xgboost
 namespace of xgboost
 
namespace  xgboost::common
 Copyright 2017-2023, XGBoost Contributors.
 

Typedefs

using xgboost::common::GHistIndexRow = Span< uint32_t const >
 A single row in global histogram index. Directly represent the global index in the histogram entry.
 
using xgboost::common::GHistRow = Span< xgboost::GradientPairPrecise >
 
using xgboost::common::ConstGHistRow = Span< xgboost::GradientPairPrecise const >
 

Enumerations

enum  BinTypeSize : uint8_t { kUint8BinsTypeSize = 1 , kUint16BinsTypeSize = 2 , kUint32BinsTypeSize = 4 }
 

Functions

HistogramCuts xgboost::common::SketchOnDMatrix (Context const *ctx, DMatrix *m, bst_bin_t max_bins, bool use_sorted=false, Span< float const > hessian={})
 Run CPU sketching on DMatrix.
 
template<typename Fn >
auto xgboost::common::DispatchBinType (BinTypeSize type, Fn &&fn)
 Dispatch for bin type, fn is a function that accepts a scalar of the bin type.
 
template<typename GradientIndex >
bst_bin_t XGBOOST_HOST_DEV_INLINE xgboost::common::BinarySearchBin (std::size_t begin, std::size_t end, GradientIndex const &data, bst_feature_t const fidx_begin, bst_feature_t const fidx_end)
 
void xgboost::common::IncrementHist (GHistRow dst, ConstGHistRow add, std::size_t begin, std::size_t end)
 Increment hist as dst += add in range [begin, end)
 
void xgboost::common::CopyHist (GHistRow dst, const GHistRow src, size_t begin, size_t end)
 Copy hist from src to dst in range [begin, end)
 
void xgboost::common::SubtractionHist (GHistRow dst, const GHistRow src1, const GHistRow src2, size_t begin, size_t end)
 Compute Subtraction: dst = src1 - src2 in range [begin, end)
 
template<bool any_missing>
void xgboost::common::BuildHist (Span< GradientPair const > gpair, const RowSetCollection::Elem row_indices, const GHistIndexMatrix &gmat, GHistRow hist, bool force_read_by_column)
 

Detailed Description

Copyright 2017-2023 by XGBoost Contributors.

Utility for fast histogram aggregation

Author
Philip Cho, Tianqi Chen