Medial Code Documentation
Loading...
Searching...
No Matches
gradient_index_page_source.h
1
4#ifndef XGBOOST_DATA_GRADIENT_INDEX_PAGE_SOURCE_H_
5#define XGBOOST_DATA_GRADIENT_INDEX_PAGE_SOURCE_H_
6
7#include <memory>
8#include <utility>
9
10#include "gradient_index.h"
11#include "sparse_page_source.h"
12
13namespace xgboost {
14namespace data {
15class GradientIndexPageSource : public PageSourceIncMixIn<GHistIndexMatrix> {
17 bool is_dense_;
18 int32_t max_bin_per_feat_;
20 double sparse_thresh_;
21
22 public:
23 GradientIndexPageSource(float missing, int nthreads, bst_feature_t n_features, size_t n_batches,
24 std::shared_ptr<Cache> cache, BatchParam param,
25 common::HistogramCuts cuts, bool is_dense,
27 std::shared_ptr<SparsePageSource> source)
28 : PageSourceIncMixIn(missing, nthreads, n_features, n_batches, cache,
29 std::isnan(param.sparse_thresh)),
30 cuts_{std::move(cuts)},
31 is_dense_{is_dense},
32 max_bin_per_feat_{param.max_bin},
33 feature_types_{feature_types},
34 sparse_thresh_{param.sparse_thresh} {
35 this->source_ = source;
36 this->Fetch();
37 }
38
39 void Fetch() final;
40};
41} // namespace data
42} // namespace xgboost
43#endif // XGBOOST_DATA_GRADIENT_INDEX_PAGE_SOURCE_H_
Definition hist_util.h:37
span class implementation, based on ISO++20 span<T>. The interface should be the same.
Definition span.h:424
Definition gradient_index_page_source.h:15
Definition sparse_page_source.h:375
namespace of xgboost
Definition base.h:90
uint32_t bst_feature_t
Type for data column (feature) index.
Definition base.h:101
Copyright 2014-2023, XGBoost Contributors.
Parameters for constructing histogram index batches.
Definition data.h:244