nirs4all.pipeline.dagml.target_capture module

Target-output transforms attached only to captured host artifacts.

Training and native scoring operate in the dataset’s numeric target space. Exported predictors additionally need to restore the labels supplied by the user. Keeping that decoder outside the runtime y_processing transform prevents decoded labels from leaking back into DAG score blocks.

class nirs4all.pipeline.dagml.target_capture.CapturedTargetTransform(transformer: Any, decoder: Any)[source]

Bases: TransformerMixin, BaseEstimator

Compose an optional model-target transform with a fitted label decoder.

property classes_: Any

Expose the captured public class axis when the decoder has one.

decode(y: Any) → Any[source]

Decode numeric targets to the labels supplied by the user.

fit(y: Any, *_args: Any, **_kwargs: Any) → CapturedTargetTransform[source]
fit_transform(y: Any, *_args: Any, **_kwargs: Any) → Any[source]

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:
  • X (array-like of shape (n_samples, n_features)) – Input samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).

  • **fit_params (dict) – Additional fit parameters. Pass only if the estimator accepts additional params in its fit method.

Returns:

X_new – Transformed array.

Return type:

ndarray array of shape (n_samples, n_features_new)

inverse_numeric(y: Any) → Any[source]

Restore numeric target space without decoding labels.

inverse_transform(y: Any) → Any[source]
transform(y: Any) → Any[source]
nirs4all.pipeline.dagml.target_capture.captured_target_transform(transformer: Any, decoder: Any, estimator: Any) → Any[source]

Attach public label decoding only to estimators that emit class indices.