|
Medial Code Documentation
|
Internal data structured used by XGBoost during training. More...
#include <data.h>
Public Member Functions | |
| DMatrix ()=default | |
| default constructor | |
| virtual MetaInfo & | Info ()=0 |
| meta information of the dataset | |
| virtual void | SetInfo (const char *key, const void *dptr, DataType dtype, size_t num) |
| virtual void | SetInfo (const char *key, std::string const &interface_str) |
| virtual const MetaInfo & | Info () const =0 |
| meta information of the dataset | |
| XGBAPIThreadLocalEntry & | GetThreadLocal () const |
| Get thread local memory for returning data from DMatrix. | |
| virtual Context const * | Ctx () const =0 |
| Get the context object of this DMatrix. | |
| template<typename T > | |
| BatchSet< T > | GetBatches () |
| Gets batches. | |
| 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 |
| virtual bool | SingleColBlock () const =0 |
| virtual | ~DMatrix () |
| virtual destructor | |
| bool | IsDense () const |
| Whether the matrix is dense. | |
| virtual DMatrix * | Slice (common::Span< int32_t const > ridxs)=0 |
| virtual DMatrix * | SliceCol (int num_slices, int slice_id)=0 |
| Slice a DMatrix by columns. | |
| template<> | |
| BatchSet< SparsePage > | GetBatches () |
| template<> | |
| bool | PageExists () const |
| template<> | |
| bool | PageExists () const |
| template<> | |
| bool | PageExists () const |
| template<> | |
| BatchSet< SparsePage > | GetBatches (Context const *) |
| template<> | |
| BatchSet< CSCPage > | GetBatches (Context const *ctx) |
| template<> | |
| BatchSet< SortedCSCPage > | GetBatches (Context const *ctx) |
| template<> | |
| BatchSet< EllpackPage > | GetBatches (Context const *ctx, BatchParam const ¶m) |
| template<> | |
| BatchSet< GHistIndexMatrix > | GetBatches (Context const *ctx, BatchParam const ¶m) |
| template<> | |
| BatchSet< ExtSparsePage > | GetBatches (Context const *ctx, BatchParam const ¶m) |
Static Public Member Functions | |
| static DMatrix * | Load (const std::string &uri, bool silent=true, DataSplitMode data_split_mode=DataSplitMode::kRow) |
| Load DMatrix from URI. | |
| template<typename AdapterT > | |
| static DMatrix * | Create (AdapterT *adapter, float missing, int nthread, const std::string &cache_prefix="", DataSplitMode data_split_mode=DataSplitMode::kRow) |
| Creates a new DMatrix from an external data adapter. | |
| 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, int nthread, bst_bin_t max_bin) |
| Create a new Quantile based DMatrix used for histogram based algorithm. | |
| template<typename DataIterHandle , typename DMatrixHandle , typename DataIterResetCallback , typename XGDMatrixCallbackNext > | |
| static DMatrix * | Create (DataIterHandle iter, DMatrixHandle proxy, DataIterResetCallback *reset, XGDMatrixCallbackNext *next, float missing, int32_t nthread, std::string cache) |
| Create an external memory DMatrix with callbacks. | |
Protected Member Functions | |
| 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 |
Internal data structured used by XGBoost during training.
|
static |
Creates a new DMatrix from an external data adapter.
| AdapterT | Type of the adapter. |
| [in,out] | adapter | View onto an external data. |
| missing | Values to count as missing. | |
| nthread | Number of threads for construction. | |
| cache_prefix | (Optional) The cache prefix for external memory. | |
| data_split_mode | (Optional) Data split mode. |
|
static |
Create an external memory DMatrix with callbacks.
| DataIterHandle | External iterator type, defined in C API. |
| DMatrixHandle | DMatrix handle, defined in C API. |
| DataIterResetCallback | Callback for reset, prototype defined in C API. |
| XGDMatrixCallbackNext | Callback for next, prototype defined in C API. |
| iter | External data iterator |
| proxy | A hanlde to ProxyDMatrix |
| reset | Callback for reset |
| next | Callback for next |
| missing | Value that should be treated as missing. |
| nthread | number of threads used for initialization. |
| cache | Prefix of cache file path. |
|
static |
Create a new Quantile based DMatrix used for histogram based algorithm.
| DataIterHandle | External iterator type, defined in C API. |
| DMatrixHandle | DMatrix handle, defined in C API. |
| DataIterResetCallback | Callback for reset, prototype defined in C API. |
| XGDMatrixCallbackNext | Callback for next, prototype defined in C API. |
| iter | External data iterator |
| proxy | A hanlde to ProxyDMatrix |
| ref | Reference Quantile DMatrix. |
| reset | Callback for reset |
| next | Callback for next |
| missing | Value that should be treated as missing. |
| nthread | number of threads used for initialization. |
| max_bin | Maximum number of bins. |
|
pure virtual |
| BatchSet< T > xgboost::DMatrix::GetBatches | ( | ) |
Gets batches.
Use range based for loop over BatchSet to access individual batches.
|
static |
|
pure virtual |
|
pure virtual |