XGBoostV0.1_UpdateOneIter_Doboost_Make_FindSplit_第一层深
2016-09-29 21:50:54 0 举报
XGBoostV0.1_UpdateOneIter_Doboost_Make_FindSplit_第一层深,这是XGBoost模型训练过程中的一个关键步骤。在这个步骤中,模型首先会更新一次迭代,然后进行boost操作,即增加一个新的弱分类器。接着,模型会根据当前的数据集寻找最佳的分割点,以便将数据集划分为两个子集。这个过程在模型的第一层深度中进行,意味着模型正在尝试找到一个能够最好地区分数据的分割点。这个步骤对于模型的性能至关重要,因为它可以帮助模型更好地理解数据的特性,从而提高预测的准确性。
作者其他创作
大纲/内容
e.sum_grad += grad[ ridx ];e.sum_hess += hess[ ridx ];e.last_fvalue = fvalue;
split_index()=sindex & ( (1U31) - 1U )
csum_grad = snode[nid].sum_grad - e.sum_grad
Yes
tree[ nid ].set_leaf( e.weight * param.learning_rate )
smat.GetSortedCol(fid)
it
it.Next() != null
csum_hess = snode[nid].sum_hess - e.sum_hess
No
tree[ nid ].is_leaf()
e.best.Update
param.need_backward_search()
nfeats = static_cast( fsplits.size() )
e.sum_grad = grad[ ridx ];e.sum_hess = hess[ ridx ];e.last_fvalue = fvalue
position[i] = tree[nid].default_left() ? tree[nid].cleft(): tree[nid].cright()
it.Next()
param.need_forward_search()
tree.AddChilds( nid )
这里split_index为fid;split_value=e.last_fvalue + delta
让该线程的sum值为该节点的sum值
delta = is_forward_search ? rt_eps:-rt_eps
tree[ nid ].split_index() == fid
e.best
this-loss_chg = loss_chgthis-sindex = split_index;this-split_value = split_value;
e.sum_hess == 0.0
classify the non-default data into right places
it.fvalue() tree[nid].split_cond()
Split_reset position
!tree[nid].is_leaf()
e.best.loss_chg rt_eps
e.sum_hess = param.min_child_weight && csum_hess = param.min_child_weight
XGBoostV0.1_UpdateOneIter_Doboost_Make_split
x
nid = 0
验证是否为首次计算
根据特征
nid=qexpand[ i ]
nid = position[i]
position[i] = -1
position[ ridx ] = tree[ nid ].cleft()
ColIter it = smat.GetSortedCol( fid )
loss_log
split_value
合并线程统计值
nid = tree[ nid ].parent()
FindSplit
position[ ridx ] = tree[ nid ].cright()
fabsf(fvalue - e.last_fvalue) rt_2eps && e.sum_hess = param.min_child_weight
&e = temp[ nid ];ridx = it.rindex();
ndata = static_cast( position.size() )
split_index
return loss_chg this-loss_chg
fsplits.push_back( tree[nid].split_index() )
return !(this-loss_chg loss_chg)
false
0 条评论
下一页