class_docstr: Search structure which gives speedup at slight loss of recall.
  
  Uses cluster pruning structure as defined in:
  http://nlp.stanford.edu/IR-book/html/htmledition/cluster-pruning-1.html
  
  tldr - searching for a document in an index of K documents is naievely
      O(K). However you can create a tree structure where the first level
      is O(sqrt(K)) and each of the leaves are also O(sqrt(K)).
  
      You randomly pick sqrt(K) items to be in the top level. Then for
      the K doccuments you assign it to the closest neighbor in the top
      level.
  
      This breaks up one O(K) search into O(2 * sqrt(K)) searches which
      is much much faster when K is big.
  
      This generalizes to h levels. The runtime becomes:
          O(h * h_root(K))
class_docstr_tok: ["Search","structure","which","gives","speedup","at","slight","loss","of","recall",".","Uses","cluster","pruning","structure","as","defined","in",":","http",":","\/\/nlp.stanford.edu\/IR-book\/html\/htmledition\/cluster-pruning-1.html","tldr","-","searching","for","a","document","in","an","index","of","K","documents","is","naievely","O","(","K",")",".","However","you","can","create","a","tree","structure","where","the","first","level","is","O","(","sqrt","(","K",")",")","and","each","of","the","leaves","are","also","O","(","sqrt","(","K",")",")",".","You","randomly","pick","sqrt","(","K",")","items","to","be","in","the","top","level",".","Then","for","the","K","doccuments","you","assign","it","to","the","closest","neighbor","in","the","top","level",".","This","breaks","up","one","O","(","K",")","search","into","O","(","2","*","sqrt","(","K",")",")","searches","which","is","much","much","faster","when","K","is","big",".","This","generalizes","to","h","levels",".","The","runtime","becomes",":","O","(","h","*","h_root","(","K",")",")"]
docstr: Yield the max depth of the tree index
docstr_tok: ["Yield","the","max","depth","of","the","tree","index"]
code: def _max_depth(self):
      """Yield the max depth of the tree index"""
      if not self.is_terminal:
          max_dep = 0
          for index in self.root.records_data:
              max_dep = max(max_dep, index._max_depth())
          return 1 + max_dep
      else:
          return 1
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import collections
  import random
  import numpy
  import pysparnn.matrix_distance
label_desc: Use image node_id 8 for calling the ClusterIndex obj's underlying member method code with example usage: obj._max_depth() and returns: unknown, int