【发布时间】:2015-11-10 02:06:02
【问题描述】:
有人能解释一下xgboost R 包中的Cover 列是如何在xgb.model.dt.tree 函数中计算的吗?
在文档中它说 Cover “是衡量受拆分影响的观察数量的指标”。
当您运行以下代码时,xgboost 文档中给出了此函数,树 0 的节点 0 的 Cover 为 1628.2500。
data(agaricus.train, package='xgboost')
#Both dataset are list with two items, a sparse matrix and labels
#(labels = outcome column which will be learned).
#Each column of the sparse Matrix is a feature in one hot encoding format.
train <- agaricus.train
bst <- xgboost(data = train$data, label = train$label, max.depth = 2,
eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
#agaricus.test$data@Dimnames[[2]] represents the column names of the sparse matrix.
xgb.model.dt.tree(agaricus.train$data@Dimnames[[2]], model = bst)
train 数据集中有 6513 个观察值,所以谁能解释为什么树 0 的节点 0 的 Cover 是这个数字 (1628.25) 的四分之一?
另外,树 1 的节点 1 的 Cover 是 788.852 - 这个数字是如何计算的?
任何帮助将不胜感激。谢谢。
【问题讨论】: