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 of i, 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_engine option. 'fast' is chosen per tree: see the Notes of BPTree.

Returns:
array of intp

parent(i) for each position (-1 for the root), in the shape of i. Its array backend and device are those of i (see close_batch).

See also

parent