MCPcopy Index your code
hub / github.com/ddbourgin/numpy-ml / BallTreeNode

Class BallTreeNode

numpy_ml/utils/data_structures.py:176–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174
175
176class BallTreeNode:
177 def __init__(self, centroid=None, X=None, y=None):
178 self.left = None
179 self.right = None
180 self.radius = None
181 self.is_leaf = False
182
183 self.data = X
184 self.targets = y
185 self.centroid = centroid
186
187 def __repr__(self):
188 fstr = "BallTreeNode(centroid={}, is_leaf={})"
189 return fstr.format(self.centroid, self.is_leaf)
190
191 def to_dict(self):
192 d = self.__dict__
193 d["id"] = "BallTreeNode"
194 return d
195
196
197class BallTree:

Callers 2

fitMethod · 0.85
_build_treeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected