(self, nodes)
return new_nodes
decrypte hess and grad and return tree node list that only contains leaves
decrypte hess and grad and return tree node list that only contains leaves
decrypte hess and grad and return tree node list that only contains leaves
def handle_leaf_nodes(self, nodes):
        """
        decrypte hess and grad and return tree node list that only contains leaves
        """
        max_node_id = -1
        for n in nodes:
            n.sum_hess = self.decrypt(n.sum_hess)
            n.sum_grad = self.decrypt(n.sum_grad)
            n.weight = self.splitter.node_weight(n.sum_grad, n.sum_hess)
            n.sitename = self.sitename
            if n.id > max_node_id:
                max_node_id = n.id
        new_nodes = [Node() for i in range(max_node_id+1)]
        for n in nodes:
            new_nodes[n.id] = n
        return new_nodes
def handle_leaf_nodes ( self , nodes ) : max_node_id = - 1 for n in nodes : n . sum_hess = self . decrypt ( n . sum_hess ) n . sum_grad = self . decrypt ( n . sum_grad ) n . weight = self . splitter . node_weight ( n . sum_grad , n . sum_hess ) n . sitename = self . sitename if n . id > max_node_id : max_node_id = n . id new_nodes = [ Node ( ) for i in range ( max_node_id + 1 ) ] for n in nodes : new_nodes [ n . id ] = n return new_nodes