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: Called after inserting or removing leaves. Updates the stored count of leaves
  beneath each branch (branch.n).
docstr_tok: ["Called","after","inserting","or","removing","leaves",".","Updates","the","stored","count","of","leaves","beneath","each","branch","(","branch.n",")","."]
code: def _update_leaf_count_upwards(self, node, inc=1):
      """
      Called after inserting or removing leaves. Updates the stored count of leaves
      beneath each branch (branch.n).
      """
      while node:
          node.n += inc
          node = node.u
  
imports: import numpy
label_desc: Use image node_id 8 for calling the RCTree obj's underlying member method code with example usage: obj._update_leaf_count_upwards(node, inc) without return types