woodpecker/sklearn/decisiontree/decision_tree_structure.py
def _calculate_leaf_nodes(self):
        """Used to calculate the node type.

        The array is_leaf[index] will be True in case the node with id=index is a leaf,
        or False if the node is a split node.
        """

        if len(self.is_leaf) == 0:
            self.is_leaf = np.zeros(shape=self.node_count, dtype=bool)
            stack = [(0)]  # seed is the root node id and its parent depth
            while len(stack) > 0:
                node_id = stack.pop()
                # If we have a test node
                if self.children_left[node_id] != self.children_right[node_id]:
                    stack.append((self.children_left[node_id]))
                    stack.append((self.children_right[node_id]))
                else:
                    self.is_leaf[node_id] = True
Used to calculate the node type.

        The array is_leaf[index] will be True in case the node with id=index is a leaf,
        or False if the node is a split node.
        
Used to calculate the node type.
The array is_leaf[index] will be True in case the node with id=index is a leaf,
or False if the node is a split node.
Used to calculate the node type . The array is_leaf [ index ] will be True in case the node with id = index is a leaf or False if the node is a split node .
def _calculate_leaf_nodes(self):
        if len(self.is_leaf) == 0:
            self.is_leaf = np.zeros(shape=self.node_count, dtype=bool)
            stack = [(0)]  
            while len(stack) > 0:
                node_id = stack.pop()
                if self.children_left[node_id] != self.children_right[node_id]:
                    stack.append((self.children_left[node_id]))
                    stack.append((self.children_right[node_id]))
                else:
                    self.is_leaf[node_id] = True
def _calculate_leaf_nodes ( self ) : if len ( self . is_leaf ) == 0 : self . is_leaf = np . zeros ( shape = self . node_count , dtype = bool ) stack = [ ( 0 ) ] while len ( stack ) > 0 : node_id = stack . pop ( ) if self . children_left [ node_id ] != self . children_right [ node_id ] : stack . append ( ( self . children_left [ node_id ] ) ) stack . append ( ( self . children_right [ node_id ] ) ) else : self . is_leaf [ node_id ] = True
Used to calculate the node type.
Used to calculate the node type .
"""Used to calculate the node type.

        The array is_leaf[index] will be True in case the node with id=index is a leaf,
        or False if the node is a split node.
        """ # seed is the root node id and its parent depth # If we have a test node
self