nirs4all.pipeline.dagml.auto_transfer module

Host operator for transfer-guided preprocessing in a DAG-ML transform task.

class nirs4all.pipeline.dagml.auto_transfer.DagMLAutoTransferPreprocessor(config: dict[str, Any] | None = None)[source]

Bases: TransformerMixin, BaseEstimator

Select a preprocessing from explicit source and target partition views.

DAG-ML owns the all-observations fit scope and invokes the host transform in each native fold/refit task. The selector’s numerical work remains in the nirs4all operator, and its recommendation is retained in the fitted chain.

fit(X: Any, y: Any = None) → DagMLAutoTransferPreprocessor[source]

Reject an unpartitioned fit, which cannot preserve transfer semantics.

fit_selected(recommendation: dict[str, Any], train_x: ndarray) → DagMLAutoTransferPreprocessor[source]

Fit the selected preprocessing on one source’s training features.

fit_with_views(views: dict[str, tuple[ndarray, ndarray | None]]) → DagMLAutoTransferPreprocessor[source]

Run the legacy selector on DAG-owned source and target cohorts.

select_with_views(views: dict[str, tuple[ndarray, ndarray | None]]) → DagMLAutoTransferPreprocessor[source]

Choose once from the joint feature view before source-local fitting.

set_input_channels(widths: tuple[int, ...]) → None[source]

Preserve existing feature-augmentation processing lanes during replay.

transform(X: Any) → ndarray[source]

Replay the selected transforms, or preserve X in analysis-only mode.