|
xgboost
|
XGBoost 内部使用的数据结构,用于保存所有外部数据。更多...
#include <data.h>

公共成员函数 | |
| DMatrix ()=default | |
| 默认构造函数更多... | |
| virtual MetaInfo & | 信息 ()=0 |
| 数据集的元信息更多... | |
| virtual void | SetInfo (const char *key, std::string const &interface_str) |
| virtual const MetaInfo & | Info () const =0 |
| 数据集的元信息更多... | |
| XGBAPIThreadLocalEntry & | GetThreadLocal () const |
| 获取线程本地内存,用于从 DMatrix 返回数据。更多... | |
| virtual Context const * | Ctx () const =0 |
获取此 DMatrix 的上下文对象。该上下文是在使用用户指定的 nthread 参数构造 DMatrix 时创建的。更多... | |
| template<typename T > | |
| BatchSet< T > | GetBatches () |
| 获取批次。使用基于范围的 for 循环遍历 BatchSet 以访问单个批次。更多... | |
| template<typename T > | |
| BatchSet< T > | GetBatches (Context const *ctx) |
| template<typename T > | |
| BatchSet< T > | GetBatches (Context const *ctx, const BatchParam ¶m) |
| template<typename T > | |
| bool | PageExists () const |
| bool | SingleColBlock () const |
| virtual std::int32_t | NumBatches () const |
| virtual | ~DMatrix () |
| bool | IsDense () const |
| 矩阵是否密集。更多... | |
| virtual DMatrix * | Slice (common::Span< int32_t const > ridxs)=0 |
| virtual DMatrix * | SliceCol (int num_slices, int slice_id)=0 |
| 按列切分 DMatrix。更多... | |
| CatContainer const * | Cats () const |
| 类别字符串表示的访问器。更多... | |
| std::shared_ptr< CatContainer const > | CatsShared () const |
| template<> | |
| BatchSet< SparsePage > | GetBatches () |
| template<> | |
| bool | PageExists () const |
| template<> | |
| bool | PageExists () const |
| template<> | |
| bool | PageExists () const |
| template<> | |
| BatchSet< SparsePage > | GetBatches (Context const *) |
| template<> | |
| BatchSet< EllpackPage > | GetBatches (Context const *ctx, BatchParam const ¶m) |
静态公共成员函数 | |
| static DMatrix * | Load (const std::string &uri, bool silent=true, DataSplitMode data_split_mode=DataSplitMode::kRow) |
| 从 URI 加载 DMatrix。更多... | |
| template<typename AdapterT > | |
| static DMatrix * | Create (AdapterT *adapter, float missing, int nthread, const std::string &cache_prefix="", DataSplitMode data_split_mode=DataSplitMode::kRow) |
| 从外部数据适配器创建新的 DMatrix。更多... | |
| template<typename DataIterHandle , typename DMatrixHandle , typename DataIterResetCallback , typename XGDMatrixCallbackNext > | |
| static DMatrix * | Create (DataIterHandle iter, DMatrixHandle proxy, std::shared_ptr< DMatrix > ref, DataIterResetCallback *reset, XGDMatrixCallbackNext *next, float missing, std::int32_t nthread, bst_bin_t max_bin, std::int64_t max_quantile_blocks) |
| 创建新的基于分位数(Quantile)的 DMatrix,用于基于直方图的算法。更多... | |
| template<typename DataIterHandle , typename DMatrixHandle , typename DataIterResetCallback , typename XGDMatrixCallbackNext > | |
| static DMatrix * | Create (DataIterHandle iter, DMatrixHandle proxy, DataIterResetCallback *reset, XGDMatrixCallbackNext *next, ExtMemConfig const &config) |
| 创建带回调函数的外部内存 DMatrix。更多... | |
| template<typename DataIterHandle , typename DMatrixHandle , typename DataIterResetCallback , typename XGDMatrixCallbackNext > | |
| static DMatrix * | Create (DataIterHandle iter, DMatrixHandle proxy, std::shared_ptr< DMatrix > ref, DataIterResetCallback *reset, XGDMatrixCallbackNext *next, bst_bin_t max_bin, std::int64_t max_quantile_blocks, ExtMemConfig const &config) |
| 创建带回调函数的外部内存分位数 DMatrix。更多... | |
保护成员函数 | |
| virtual BatchSet< SparsePage > | GetRowBatches ()=0 |
| virtual BatchSet< CSCPage > | GetColumnBatches (Context const *ctx)=0 |
| virtual BatchSet< SortedCSCPage > | GetSortedColumnBatches (Context const *ctx)=0 |
| virtual BatchSet< EllpackPage > | GetEllpackBatches (Context const *ctx, BatchParam const ¶m)=0 |
| virtual BatchSet< GHistIndexMatrix > | GetGradientIndex (Context const *ctx, BatchParam const ¶m)=0 |
| virtual BatchSet< ExtSparsePage > | GetExtBatches (Context const *ctx, BatchParam const ¶m)=0 |
| virtual bool | EllpackExists () const =0 |
| virtual bool | GHistIndexExists () const =0 |
| virtual bool | SparsePageExists () const =0 |
内部数据结构,由XGBoost用于保存所有外部数据。
DMatrix 类有多个变体,可以通过 Create() 方法访问。DMatrix 本身保存预测器 X,而其他数据(包括标签和样本权重)存储在 MetaInfo 类中。
|
默认 |
默认构造函数
|
virtual |
|
inline |
类别字符串表示的访问器。
|
inline |
|
static |
|
static |
|
static |
|
static |
创建新的基于分位数(Quantile)的 DMatrix,用于基于直方图的算法。
| DataIterHandle | 外部迭代器类型,在 C API 中定义。 |
| DMatrixHandle | DMatrix 句柄,在 C API 中定义。 |
| DataIterResetCallback | 重置回调函数,原型在 C API 中定义。 |
| XGDMatrixCallbackNext | 下一个回调函数,原型在 C API 中定义。 |
| iter | 外部数据迭代器 |
| proxy | ProxyDMatrix 的句柄 |
| ref | 参考分位数 DMatrix。 |
| reset | 重置回调 |
| next | 下一个回调 |
| missing | 应视为缺失的值。 |
| nthread | 初始化使用的线程数。 |
| max_bin | 最大 bin 数。 |
|
纯虚函数 |
|
protected纯虚函数 |
| BatchSet<T> xgboost::DMatrix::GetBatches | ( | ) |
获取批次。使用基于范围的 for 循环遍历 BatchSet 以访问单个批次。
|
inline |
|
inline |
|
inline |
| BatchSet<T> xgboost::DMatrix::GetBatches | ( | Context const * | ctx, |
| const BatchParam & | param | ||
| ) |
|
protected纯虚函数 |
|
protected纯虚函数 |
|
protected纯虚函数 |
|
protected纯虚函数 |
|
protected纯虚函数 |
| XGBAPIThreadLocalEntry& xgboost::DMatrix::GetThreadLocal | ( | ) | const |
获取线程本地内存,用于从 DMatrix 返回数据。
|
protected纯虚函数 |
|
纯虚函数 |
数据集的元信息
|
纯虚函数 |
数据集的元信息
|
inline |
矩阵是否是稠密的。
|
static |
|
inlinevirtual |
| bool xgboost::DMatrix::PageExists | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
命名为传统。
|
纯虚函数 |
|
纯虚函数 |
|
protected纯虚函数 |