class_docstr: Robust random cut tree data structure as described in:
  
  S. Guha, N. Mishra, G. Roy, & O. Schrijvers. Robust random cut forest based anomaly
  detection on streams, in Proceedings of the 33rd International conference on machine
  learning, New York, NY, 2016 (pp. 2712-2721).
  
  Parameters:
  -----------
  X: np.ndarray (n x d) (optional)
     Array containing n data points, each with dimension d.
     If no data provided, an empty tree is created.
  index_labels: sequence of length n (optional) (default=None)
                Labels for data points provided in X.
                Defaults to [0, 1, ... n-1].
  precision: float (optional) (default=9)
             Floating-point precision for distinguishing duplicate points.
  random_state: int, RandomState instance or None (optional) (default=None)
      If int, random_state is the seed used by the random number generator;
      If RandomState instance, random_state is the random number generator;
      If None, the random number generator is the RandomState instance used by np.random.
  
  Attributes:
  -----------
  root: Branch or Leaf instance
        Pointer to root of tree.
  leaves: dict
          Dict containing pointers to all leaves in tree.
  ndim: int
        dimension of points in the tree
  
  Methods:
  --------
  insert_point: inserts a new point into the tree.
  forget_point: removes a point from the tree.
  disp: compute displacement associated with the removal of a leaf.
  codisp: compute collusive displacement associated with the removal of a leaf
          (anomaly score).
  map_leaves: traverses all nodes in the tree and executes a user-specified
              function on the leaves.
  map_branches: traverses all nodes in the tree and executes a user-specified
                function on the branches.
  query: finds nearest point in tree.
  get_bbox: find bounding box of points under a given node.
  find_duplicate: finds duplicate points in the tree.
  
  Example:
  --------
  # Create RCTree
  >>> X = np.random.randn(100,2)
  >>> tree = RCTree(X)
  
  # Insert a point
  >>> x = np.random.randn(2)
  >>> tree.insert_point(x, index=100)
  
  # Compute collusive displacement of new point (anomaly score)
  >>> tree.codisp(100)
  
  # Remove point
  >>> tree.forget_point(100)
class_docstr_tok: ["Robust","random","cut","tree","data","structure","as","described","in",":","S.","Guha",",","N.","Mishra",",","G.","Roy",",","&","O.","Schrijvers",".","Robust","random","cut","forest","based","anomaly","detection","on","streams",",","in","Proceedings","of","the","33rd","International","conference","on","machine","learning",",","New","York",",","NY",",","2016","(","pp",".","2712-2721",")",".","Parameters",":","--","--","--","--","--","-","X",":","np.ndarray","(","n","x","d",")","(","optional",")","Array","containing","n","data","points",",","each","with","dimension","d.","If","no","data","provided",",","an","empty","tree","is","created",".","index_labels",":","sequence","of","length","n","(","optional",")","(","default=None",")","Labels","for","data","points","provided","in","X.","Defaults","to","[","0",",","1",",","...","n-1","]",".","precision",":","float","(","optional",")","(","default=9",")","Floating-point","precision","for","distinguishing","duplicate","points",".","random_state",":","int",",","RandomState","instance","or","None","(","optional",")","(","default=None",")","If","int",",","random_state","is","the","seed","used","by","the","random","number","generator",";","If","RandomState","instance",",","random_state","is","the","random","number","generator",";","If","None",",","the","random","number","generator","is","the","RandomState","instance","used","by","np.random",".","Attributes",":","--","--","--","--","--","-","root",":","Branch","or","Leaf","instance","Pointer","to","root","of","tree",".","leaves",":","dict","Dict","containing","pointers","to","all","leaves","in","tree",".","ndim",":","int","dimension","of","points","in","the","tree","Methods",":","--","--","--","--","insert_point",":","inserts","a","new","point","into","the","tree",".","forget_point",":","removes","a","point","from","the","tree",".","disp",":","compute","displacement","associated","with","the","removal","of","a","leaf",".","codisp",":","compute","collusive","displacement","associated","with","the","removal","of","a","leaf","(","anomaly","score",")",".","map_leaves",":","traverses","all","nodes","in","the","tree","and","executes","a","user-specified","function","on","the","leaves",".","map_branches",":","traverses","all","nodes","in","the","tree","and","executes","a","user-specified","function","on","the","branches",".","query",":","finds","nearest","point","in","tree",".","get_bbox",":","find","bounding","box","of","points","under","a","given","node",".","find_duplicate",":","finds","duplicate","points","in","the","tree",".","Example",":","--","--","--","--","#","Create","RCTree",">",">",">","X","=","np.random.randn","(","100,2",")",">",">",">","tree","=","RCTree","(","X",")","#","Insert","a","point",">",">",">","x","=","np.random.randn","(","2",")",">",">",">","tree.insert_point","(","x",",","index=100",")","#","Compute","collusive","displacement","of","new","point","(","anomaly","score",")",">",">",">","tree.codisp","(","100",")","#","Remove","point",">",">",">","tree.forget_point","(","100",")"]
docstr: Compute bounding box of all points underneath a given branch.
  
  Parameters:
  -----------
  branch: Branch instance
          Starting branch. Defaults to root of tree.
  
  Returns:
  --------
  bbox: np.ndarray (2 x d)
        Bounding box of all points underneath branch
  
  Example:
  --------
  # Create RCTree and compute bbox
  >>> X = np.random.randn(10, 3)
  >>> tree = rrcf.RCTree(X)
  >>> tree.get_bbox()
  
  array([[-0.8600458 , -1.69756215, -1.16659065],
         [ 2.48455863,  1.02869042,  1.09414144]])
docstr_tok: ["Compute","bounding","box","of","all","points","underneath","a","given","branch",".","Parameters",":","--","--","--","--","--","-","branch",":","Branch","instance","Starting","branch",".","Defaults","to","root","of","tree",".","Returns",":","--","--","--","--","bbox",":","np.ndarray","(","2","x","d",")","Bounding","box","of","all","points","underneath","branch","Example",":","--","--","--","--","#","Create","RCTree","and","compute","bbox",">",">",">","X","=","np.random.randn","(","10",",","3",")",">",">",">","tree","=","rrcf.RCTree","(","X",")",">",">",">","tree.get_bbox","(",")","array","(","[","[","-0.8600458",",","-1.69756215",",","-1.16659065","]",",","[","2.48455863",",","1.02869042",",","1.09414144","]","]",")"]
code: def get_bbox(self, branch=None):
      """
      Compute bounding box of all points underneath a given branch.
  
      Parameters:
      -----------
      branch: Branch instance
              Starting branch. Defaults to root of tree.
  
      Returns:
      --------
      bbox: np.ndarray (2 x d)
            Bounding box of all points underneath branch
  
      Example:
      --------
      # Create RCTree and compute bbox
      >>> X = np.random.randn(10, 3)
      >>> tree = rrcf.RCTree(X)
      >>> tree.get_bbox()
  
      array([[-0.8600458 , -1.69756215, -1.16659065],
             [ 2.48455863,  1.02869042,  1.09414144]])
      """
      if branch is None:
          branch = self.root
      mins = np.full(self.ndim, np.inf)
      maxes = np.full(self.ndim, -np.inf)
      self.map_leaves(branch, op=self._get_bbox, mins=mins, maxes=maxes)
      bbox = np.vstack([mins, maxes])
      return bbox
  
imports: import numpy
label_desc: Use image node_id 14 for calling the RCTree obj's underlying member method code with example usage: obj.get_bbox(branch) and returns: bbox