(self, cur_to_split: List[Node], split_info: List[SplitInfo])
return next_layer_node
update current tree structure
        ----------
        split_info
update current tree structure
        ----------
        split_info
update current tree structure ---------- split_info
def update_tree(self, cur_to_split: List[Node], split_info: List[SplitInfo]):
        """
        update current tree structure
        ----------
        split_info
        """
        LOGGER.debug('updating tree_node, cur layer has {} node'.format(len(cur_to_split)))
        next_layer_node = []
        assert len(cur_to_split) == len(split_info)

        for idx in range(len(cur_to_split)):
            sum_grad = cur_to_split[idx].sum_grad
            sum_hess = cur_to_split[idx].sum_hess
            if split_info[idx].best_fid is None or split_info[idx].gain <= self.min_impurity_split + consts.FLOAT_ZERO:
                cur_to_split[idx].is_leaf = True
                self.tree_node.append(cur_to_split[idx])
                continue

            cur_to_split[idx].fid = split_info[idx].best_fid
            cur_to_split[idx].bid = split_info[idx].best_bid
            cur_to_split[idx].missing_dir = split_info[idx].missing_dir

            p_id = cur_to_split[idx].id
            l_id, r_id = self.tree_node_num + 1, self.tree_node_num + 2
            cur_to_split[idx].left_nodeid, cur_to_split[idx].right_nodeid = l_id, r_id
            self.tree_node_num += 2

            l_g, l_h = split_info[idx].sum_grad, split_info[idx].sum_hess

            # create new left node and new right node
            left_node = Node(id=l_id,
                             sitename=self.sitename,
                             sum_grad=l_g,
                             sum_hess=l_h,
                             weight=self.splitter.node_weight(l_g, l_h),
                             parent_nodeid=p_id,
                             sibling_nodeid=r_id,
                             is_left_node=True)
            right_node = Node(id=r_id,
                              sitename=self.sitename,
                              sum_grad=sum_grad - l_g,
                              sum_hess=sum_hess - l_h,
                              weight=self.splitter.node_weight(sum_grad - l_g, sum_hess - l_h),
                              parent_nodeid=p_id,
                              sibling_nodeid=l_id,
                              is_left_node=False)

            next_layer_node.append(left_node)
            next_layer_node.append(right_node)
            self.tree_node.append(cur_to_split[idx])

            self.update_feature_importance(split_info[idx], record_site_name=False)

        return next_layer_node
def update_tree ( self , cur_to_split : List [ Node ] , split_info : List [ SplitInfo ] ) : LOGGER . debug ( 'updating tree_node, cur layer has {} node' . format ( len ( cur_to_split ) ) ) next_layer_node = [ ] assert len ( cur_to_split ) == len ( split_info ) for idx in range ( len ( cur_to_split ) ) : sum_grad = cur_to_split [ idx ] . sum_grad sum_hess = cur_to_split [ idx ] . sum_hess if split_info [ idx ] . best_fid is None or split_info [ idx ] . gain <= self . min_impurity_split + consts . FLOAT_ZERO : cur_to_split [ idx ] . is_leaf = True self . tree_node . append ( cur_to_split [ idx ] ) continue cur_to_split [ idx ] . fid = split_info [ idx ] . best_fid cur_to_split [ idx ] . bid = split_info [ idx ] . best_bid cur_to_split [ idx ] . missing_dir = split_info [ idx ] . missing_dir p_id = cur_to_split [ idx ] . id l_id , r_id = self . tree_node_num + 1 , self . tree_node_num + 2 cur_to_split [ idx ] . left_nodeid , cur_to_split [ idx ] . right_nodeid = l_id , r_id self . tree_node_num += 2 l_g , l_h = split_info [ idx ] . sum_grad , split_info [ idx ] . sum_hess # create new left node and new right node left_node = Node ( id = l_id , sitename = self . sitename , sum_grad = l_g , sum_hess = l_h , weight = self . splitter . node_weight ( l_g , l_h ) , parent_nodeid = p_id , sibling_nodeid = r_id , is_left_node = True ) right_node = Node ( id = r_id , sitename = self . sitename , sum_grad = sum_grad - l_g , sum_hess = sum_hess - l_h , weight = self . splitter . node_weight ( sum_grad - l_g , sum_hess - l_h ) , parent_nodeid = p_id , sibling_nodeid = l_id , is_left_node = False ) next_layer_node . append ( left_node ) next_layer_node . append ( right_node ) self . tree_node . append ( cur_to_split [ idx ] ) self . update_feature_importance ( split_info [ idx ] , record_site_name = False ) return next_layer_node