fan_in

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

fan_in(units: Sequence[Supervoxelization]) → PooledUnits[source]

Merge per-subject clustering units into one indexed cohort matrix.

Row order is cohort order and never sorted or shuffled, because clustering can be order-sensitive; the same contract holds in pool_supervoxel_features(), which the model fitters pool with, so PooledUnits.matrix carries the very rows a fitter would see.

Parameters:

units – Clustering units in cohort order.

Returns:

The pooled matrix together with its subject index.

Raises:
  • HABITAPIError – If units is empty or two units share a subject id (fan-out could not route rows back unambiguously).

  • CompatibilityError – If feature columns differ between subjects.