BGlib.be.analysis.utils.tree.Node¶
- class BGlib.be.analysis.utils.tree.Node(name, value=None, parent=None, dist=0, labels=None, children=[], compute_mean=False, verbose=False)[source]¶
Bases:
object
Basic unit of a tree - a node. Keeps track of its value, labels, parent, children, level in the tree etc.
- Parameters:
name ((Optional) unsigned int) – ID of this node
value ((Optional) 1D numpy array) – Response corresponding to this Node.
parent ((Optional) unsigned int or Node object) – Parent for this Node.
dist ((Optional) float) – Distance between the children nodes
labels ((Optional) list or 1D numpy array of unsigned integers) – Positions / instances in a main dataset within this cluster
children ((Optional) list of Node objects) – Children for this node
compute_mean ((Optional) Boolean) – Whether or not to compute the value attribute from the provided children
Methods