skbio.tree.BPTree.parent_batch#
- BPTree.parent_batch(i, engine=None)[source]#
Parent of each node in a batch.
The batch counterpart of
parent: one independent query per element ofi, computed by the selected engine.- Parameters:
- iarray-like of int
Node positions to evaluate.
- engine{‘cython’, ‘numba’, ‘fast’}, optional
The compute engine. Defaults to the global
compute_engineoption.'fast'is chosen per tree: see the Notes ofBPTree.
- Returns:
- array of intp
parent(i)for each position (-1 for the root), in the shape ofi. Its array backend and device are those ofi(seeclose_batch).
See also