我正在使用xgboost进行排名
param = {'objective':'rank:pairwise', 'booster':'gbtree'}
Run Code Online (Sandbox Code Playgroud)
据我所知,通过计算学习决策树的加权和来实现梯度增强.如何访问分配给每个学习助推器的权重?我想在训练后尝试对加权进行后处理,以加快预测步骤,但我不知道如何获得单独的权重.使用时dump_model(),可以在创建的文件中看到不同的决策树,但不存储加权.在API中我没有找到合适的功能.或者我可以用收缩参数手动计算重量eta吗?
有人可以解释如何在函数中计算R包中的Cover列吗?xgboostxgb.model.dt.tree
在文档中,它说Cover "是衡量受分割影响的观察数量的指标".
当您运行xgboost此函数的文档中给出的以下代码时,Cover树0的节点0为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 …Run Code Online (Sandbox Code Playgroud)