6 #ifndef XGBOOST_MULTI_TARGET_TREE_MODEL_H_ 
 7 #define XGBOOST_MULTI_TARGET_TREE_MODEL_H_ 
 83  mutable std::mutex tree_view_lock_;
 
 90  [[nodiscard]] linalg::VectorView<float> NodeWeight(
bst_node_t nidx) {
 
 143  [[nodiscard]] std::size_t 
Size() 
const;
 
 156  return this->NodeWeight(nidx);
 
#define XGBOOST_DEVICE
Tag function as usable by device.
Definition: base.h:64
common::Span< T const > ConstHostSpan() const
Definition: host_device_vector.h:116
const std::vector< T > & ConstHostVector() const
common::Span< T > HostSpan()
定义: host_device_vector.h:114
表示JSON格式的数据结构。
Definition: json.h:392
多目标模型的树结构。
定义: multi_target_tree_model.h:69
bool IsLeaf(bst_node_t nidx) const
定义: multi_target_tree_model.h:115
bst_feature_t SplitIndex(bst_node_t nidx) const
定义: multi_target_tree_model.h:128
bst_node_t Parent(bst_node_t nidx) const
定义: multi_target_tree_model.h:118
bst_node_t RightChild(bst_node_t nidx) const
定义: multi_target_tree_model.h:124
MultiTargetTree & operator=(MultiTargetTree &&that)=delete
MultiTargetTree(MultiTargetTree const &that)
bst_target_t NumTargets() const
MultiTargetTree & operator=(MultiTargetTree const &that)=delete
void SaveModel(Json *out) const override
将模型配置保存到JSON对象
static constexpr bst_node_t InvalidNodeId()
定义: multi_target_tree_model.h:71
MultiTargetTree(TreeParam const *param)
bool DefaultLeft(bst_node_t nidx) const
定义: multi_target_tree_model.h:134
bst_node_t LeftChild(bst_node_t nidx) const
定义: multi_target_tree_model.h:121
bst_node_t DefaultChild(bst_node_t nidx) const
定义: multi_target_tree_model.h:137
MultiTargetTreeView View(Context const *ctx) const
获取树的视图。
MultiTargetTree(MultiTargetTree &&that)=delete
void SetLeaf(bst_node_t nidx, linalg::VectorView< float const > weight)
设置叶子的权重。
float SplitCond(bst_node_t nidx) const
定义: multi_target_tree_model.h:131
linalg::VectorView< float const > LeafValue(bst_node_t nidx) const
定义: multi_target_tree_model.h:154
bst_node_t Depth(bst_node_t nidx) const
定义: multi_target_tree_model.h:145
void Expand(bst_node_t nidx, bst_feature_t split_idx, float split_cond, bool default_left, linalg::VectorView< float const > base_weight, linalg::VectorView< float const > left_weight, linalg::VectorView< float const > right_weight)
将叶子节点展开为分裂节点。
void LoadModel(Json const &in) override
从JSON对象加载模型
std::size_t MemCostBytes() const
XGBOOST_DEVICE auto subspan() const -> Span< element_type, detail::ExtentValue< Extent, Offset, Count >::value >
定义: span.h:597
具有静态类型和维度的张量视图。它实现了索引和切片。
定义: linalg.h:277
LINALG_HD auto Shape() const
定义: linalg.h:506
LINALG_HD auto Slice(S &&...slices) const
切片张量。返回的张量具有推断的维度和形状。不支持标量结果。
定义: linalg.h:493
auto MakeTensorView(Context const *ctx, Container &data, S &&...shape)
用于自动类型推断的构造函数。
定义: linalg.h:564
constexpr detail::AllTag All()
指定切片轴中的所有元素。
定义: linalg.h:249
集成目标、gbm和评估的学习器接口。这是用户面临的XGB...
Definition: base.h:97
std::int32_t bst_node_t
树节点索引的类型。
定义: base.h:119
std::uint32_t bst_target_t
用于索引输出目标的类型。
定义: base.h:127
std::uint32_t bst_feature_t
数据列(特征)索引的类型。
Definition: base.h:107
XGBoost的运行时上下文。包含线程和设备等信息。
Definition: context.h:133
constexpr static auto CPU()
CPU 的构造函数。
定义: context.h:64
适合主机和设备的多目标树视图。
定义: multi_target_tree_model.h:26
bst_node_t Size() const
定义: multi_target_tree_model.h:63
XGBOOST_DEVICE float SplitCond(bst_node_t nidx) const
定义: multi_target_tree_model.h:51
std::size_t n
定义: multi_target_tree_model.h:38
linalg::MatrixView< float const > weights
定义: multi_target_tree_model.h:40
bst_target_t NumTargets() const
定义: multi_target_tree_model.h:62
bst_node_t const * parent
定义: multi_target_tree_model.h:31
XGBOOST_DEVICE bst_node_t RightChild(bst_node_t nidx) const
定义: multi_target_tree_model.h:47
bst_node_t const * left
定义: multi_target_tree_model.h:29
static constexpr bst_node_t InvalidNodeId()
定义: multi_target_tree_model.h:27
XGBOOST_DEVICE bst_node_t DefaultChild(bst_node_t nidx) const
定义: multi_target_tree_model.h:55
XGBOOST_DEVICE bool IsLeaf(bst_node_t nidx) const
定义: multi_target_tree_model.h:42
XGBOOST_DEVICE bst_node_t LeftChild(bst_node_t nidx) const
定义: multi_target_tree_model.h:46
XGBOOST_DEVICE linalg::VectorView< float const > LeafValue(bst_node_t nidx) const
定义: multi_target_tree_model.h:58
XGBOOST_DEVICE bst_feature_t SplitIndex(bst_node_t nidx) const
定义: multi_target_tree_model.h:48
std::uint8_t const * default_left
定义: multi_target_tree_model.h:34
float const * split_conds
定义: multi_target_tree_model.h:35
bst_feature_t const * split_index
定义: multi_target_tree_model.h:33
XGBOOST_DEVICE bool DefaultLeft(bst_node_t nidx) const
定义: multi_target_tree_model.h:52
bst_node_t const * right
定义: multi_target_tree_model.h:30