xgboost
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
xgboost::common::QuantileSketchTemplate< DType, RType, TSummary > Class Template Reference

template for all quantile sketch algorithm that uses merge/prune scheme More...

#include <quantile.h>

Collaboration diagram for xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >:
Collaboration graph

Classes

struct  SummaryContainer
 same as summary, but use STL to backup the space More...
 

Public Types

using Summary = TSummary
 type of summary type More...
 
using Entry = typename Summary::Entry
 the entry type More...
 

Public Member Functions

void Init (size_t maxn, double eps)
 initialize the quantile sketch, given the performance specification More...
 
void Push (DType x, RType w=1)
 add an element to a sketch More...
 
void PushSummary (const Summary &summary)
 
void PushTemp ()
 push up temp More...
 
void GetSummary (SummaryContainer *out)
 get the summary after finalize More...
 
void CheckValid (RType eps) const
 
void InitLevel (size_t nlevel)
 

Static Public Member Functions

static void LimitSizeLevel (size_t maxn, double eps, size_t *out_nlevel, size_t *out_limit_size)
 

Public Attributes

Summary::Queue inqueue
 
size_t nlevel
 
size_t limit_size
 
std::vector< Summarylevel
 
std::vector< Entrydata
 
SummaryContainer temp
 

Static Public Attributes

static constexpr float kFactor = 8.0
 

Detailed Description

template<typename DType, typename RType, class TSummary>
class xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >

template for all quantile sketch algorithm that uses merge/prune scheme

Template Parameters
DTypetype of data content
RTypetype of rank
TSummaryactual summary data structure it uses

Member Typedef Documentation

◆ Entry

template<typename DType , typename RType , class TSummary >
using xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::Entry = typename Summary::Entry

the entry type

◆ Summary

template<typename DType , typename RType , class TSummary >
using xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::Summary = TSummary

type of summary type

Member Function Documentation

◆ CheckValid()

template<typename DType , typename RType , class TSummary >
void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::CheckValid ( RType  eps) const
inline

◆ GetSummary()

template<typename DType , typename RType , class TSummary >
void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::GetSummary ( SummaryContainer out)
inline

get the summary after finalize

◆ Init()

template<typename DType , typename RType , class TSummary >
void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::Init ( size_t  maxn,
double  eps 
)
inline

initialize the quantile sketch, given the performance specification

Parameters
maxnmaximum number of data points can be feed into sketch
epsaccuracy level of summary

◆ InitLevel()

template<typename DType , typename RType , class TSummary >
void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::InitLevel ( size_t  nlevel)
inline

◆ LimitSizeLevel()

template<typename DType , typename RType , class TSummary >
static void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::LimitSizeLevel ( size_t  maxn,
double  eps,
size_t *  out_nlevel,
size_t *  out_limit_size 
)
inlinestatic

◆ Push()

template<typename DType , typename RType , class TSummary >
void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::Push ( DType  x,
RType  w = 1 
)
inline

add an element to a sketch

Parameters
xThe element added to the sketch
wThe weight of the element.

◆ PushSummary()

template<typename DType , typename RType , class TSummary >
void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::PushSummary ( const Summary summary)
inline

◆ PushTemp()

template<typename DType , typename RType , class TSummary >
void xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::PushTemp ( )
inline

push up temp

Member Data Documentation

◆ data

template<typename DType , typename RType , class TSummary >
std::vector<Entry> xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::data

◆ inqueue

template<typename DType , typename RType , class TSummary >
Summary::Queue xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::inqueue

◆ kFactor

template<typename DType , typename RType , class TSummary >
constexpr float xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::kFactor = 8.0
staticconstexpr

◆ level

template<typename DType , typename RType , class TSummary >
std::vector<Summary> xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::level

◆ limit_size

template<typename DType , typename RType , class TSummary >
size_t xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::limit_size

◆ nlevel

template<typename DType , typename RType , class TSummary >
size_t xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::nlevel

◆ temp

template<typename DType , typename RType , class TSummary >
SummaryContainer xgboost::common::QuantileSketchTemplate< DType, RType, TSummary >::temp

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