PolyPipeline

The PolyPipeline class supports mixed multiview/single-view workflows with runtime mode inference. It can run sklearn-style estimators per view in multiview mode and supports late-fusion chaining.

See also

class polyview.pipeline.polypipeline.PolyPipeline(*args: Any, **kwargs: Any)

Bases: BaseEstimator

Pipeline that supports both multiview and single-view flows.

The pipeline infers data mode at runtime from step outputs: - multiview (“mv”): list/tuple of 2-D arrays - single-view (“sv”): one 2-D array

Allowed transitions are: - mv -> mv - mv -> sv - sv -> mv - sv -> sv

A reverse transition (sv -> mv) is rejected.

draw_diagram(start_mode: Literal['mv', 'sv'] | None = None) str

Render a readable ASCII diagram of pipeline flow.

Parameters:

start_mode ({"mv", "sv"} or None, default=None) – Optional starting mode for preview. Useful before fitting. - None: use fitted input mode if available. - "mv"/"sv": simulate flow from that start mode.

Returns:

Multi-line diagram string (also printed).

Return type:

str

Examples

>>> pipe = PolyPipeline([
...     ("rp", RandomProjectionViews(n_views=3)),
...     ("scale", StandardScaler()),
...     ("cluster", MultiViewKMeans(n_clusters=3, random_state=0))
... ])
>>> print(pipe.draw_diagram(start_mode='sv'))
input
  ↓ (1 view)
[RandomProjectionViews]
  ↓ ↓ ↓ (3 views)
[StandardScaler]
  ↓ ↓ ↓ (3 views)
[MultiViewKMeans]
  ↓ (1 output)
output
fit(X: Any, y: Any = None) PolyPipeline
fit_predict(X: Any, y: Any = None) Any
fit_transform(X: Any, y: Any = None) Any
predict(X: Any) Any
score(X: Any, y: Any = None) Any
transform(X: Any) Any