class_docstr: An encapsulation of the structure of a single decision tree
  Contains no logic, but keeps track of 4 different kinds of nodes within the tree:
    - leaf nodes
    - decision nodes
    - splittable leaf nodes
    - prunable decision nodes
  
  Parameters
  ----------
  nodes: List[Node]
      All nodes contained in the tree, i.e. decision and leaf nodes
class_docstr_tok: ["An","encapsulation","of","the","structure","of","a","single","decision","tree","Contains","no","logic",",","but","keeps","track","of","4","different","kinds","of","nodes","within","the","tree",":","-","leaf","nodes","-","decision","nodes","-","splittable","leaf","nodes","-","prunable","decision","nodes","Parameters","--","--","--","--","--","nodes",":","List","[","Node","]","All","nodes","contained","in","the","tree",",","i.e",".","decision","and","leaf","nodes"]
docstr: Prediction for a covariate matrix not used for training
  
  Note that this is quite slow
  
  Parameters
  ----------
  X: pd.DataFrame
      Covariates to predict for
  Returns
  -------
  np.ndarray
docstr_tok: ["Prediction","for","a","covariate","matrix","not","used","for","training","Note","that","this","is","quite","slow","Parameters","--","--","--","--","--","X",":","pd.DataFrame","Covariates","to","predict","for","Returns","--","--","--","-","np.ndarray"]
code: def _out_of_sample_predict(self, X) -> np.ndarray:
      """
      Prediction for a covariate matrix not used for training
  
      Note that this is quite slow
  
      Parameters
      ----------
      X: pd.DataFrame
          Covariates to predict for
      Returns
      -------
      np.ndarray
      """
      prediction = np.array([0.0] * len(X))
      for leaf in self.leaf_nodes:
          prediction[leaf.split.condition(X)] = leaf.predict()
      return prediction
  
file_path: imodels/imodels/experimental/bartpy/tree.py
imports: from typing import List
  import numpy
  from .mutation import TreeMutation
  from .node import TreeNode, LeafNode, DecisionNode, deep_copy_node
label_desc: Use image node_id 9 for calling the Tree obj's underlying member method code with example usage: obj._out_of_sample_predict(X) and returns: prediction