From 9684869e00ffb7f7dede316aa08325c5909eeb89 Mon Sep 17 00:00:00 2001 From: Zhangqiu Yu Date: Wed, 25 Oct 2017 21:27:03 -0500 Subject: [PATCH] computation of w in xgboost's tutorial https://xgboost.readthedocs.io/en/latest/model.html, they said w = -G/(H+lamda), but you just use -G/H here, will it cause problems? --- R/getStatsForTrees.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/getStatsForTrees.R b/R/getStatsForTrees.R index 9f6261b..f6e3bf8 100644 --- a/R/getStatsForTrees.R +++ b/R/getStatsForTrees.R @@ -55,7 +55,7 @@ getStatsForTrees = function(trees, nodes.train, type = "binary", base_score = 0. rightG = tree[ID==right,G] tree[r,G:=leftG+rightG] - w=tree[r,-G/H] + w=tree[r,-G/H] # w=tree[r,-G/(H+lambda)] tree[r,weight:=w] tree[ID==left,previous_weight:=w] @@ -67,4 +67,4 @@ getStatsForTrees = function(trees, nodes.train, type = "binary", base_score = 0. } return (tree_list) -} \ No newline at end of file +}