(self, X)
return y
Prediction that does not use compiled trees; for demo only
Prediction that does not use compiled trees; for demo only
Prediction that does not use compiled trees ; for demo only
def get_values_by_nodes(self, X):
        """Prediction that does not use compiled trees; for demo only"""
        n = len(X)
        y = self._prepare_predictions(n)
        for i in range(n):
            x = X[i]
            node = self.root
            while True:
                child_idx = node.descend(x)
                if np.isnan(child_idx):
                    break
                next_node = node.children[child_idx]
                if next_node is None:
                    break
                node = next_node
            y[i] = node.value
        return y
def get_values_by_nodes ( self , X ) : n = len ( X ) y = self . _prepare_predictions ( n ) for i in range ( n ) : x = X [ i ] node = self . root while True : child_idx = node . descend ( x ) if np . isnan ( child_idx ) : break next_node = node . children [ child_idx ] if next_node is None : break node = next_node y [ i ] = node . value return y