build_pca_tree

build_pca_tree(embeddings, max_depth, min_leaf_size=2)

Build a PCA bisection tree over embeddings.

Parameters

Name Type Description Default
embeddings (n, d) array of embedding vectors. required
max_depth Maximum tree depth (number of recursive splits). required
min_leaf_size Stop splitting when a node has fewer than 2 * min_leaf_size points. 2

Returns

Name Type Description
Tree dict with keys: left, right, indices, depth, point_margin_map.