Skip to content

Tessero\Cluster\Hierarchy\ClusterNode

← All classes

AI assistant

Build this with Claude Code, Cursor or Copilot

Copy a Tessero-tuned prompt for Tessero\Cluster\Hierarchy\ClusterNode, grounded in 6 real API signatures , into your IDE's AI. No chatbot, just exact context.

__construct
__construct(int $id, ?Tessero\Cluster\Hierarchy\ClusterNode $left = null, ?Tessero\Cluster\Hierarchy\ClusterNode $right = null, float $dist = 0.0, ?int $count = null)
getId
getId(): int

The cluster id of this node (scipy ClusterNode.get_id).

getCount
getCount(): int

The number of original observations in the cluster rooted at this node (scipy get_count).

getLeft
getLeft(): ?Tessero\Cluster\Hierarchy\ClusterNode

The left child, or null for a leaf (scipy get_left).

getRight
getRight(): ?Tessero\Cluster\Hierarchy\ClusterNode

The right child, or null for a leaf (scipy get_right).

isLeaf
isLeaf(): bool

True when this node is a leaf (an original observation). scipy is_leaf.

preOrder
preOrder(?callable $func = null): array

Left-first pre-order traversal returning a leaf value per original observation (scipy pre_order). The default $func returns each leaf's id; pass a callable to map each leaf ClusterNode to a value. Iterative (matches scipy's explicit-stack implementation and avoids recursion limits).