Recipe#
- class sdm.processing.recipe.Recipe(features: Processor | Iterable[Processor] | None = None, target: Processor | Iterable[Processor] | None = None, output: Processor | Iterable[Processor] | None = None)#
Bases:
objectProcessing contract around an external model boundary.
A recipe bundles three processing pipelines, one per role the data plays relative to the model:
features: model inputs, transformed before the model.target: labels transformed forward before the model. Regression predictions are inverted through this pipeline; classification outputs are reconstructed from the fitted target categories instead.output: transforms member outputs after they have been mapped to a common class or target space and stacked as[E, ..., R, O]. An explicit dimension-changing step such asAverageEstimatorsremovesE; without one, the output remains stacked. Steps before the reducer must support stacked outputs, while steps after it receive already-reduced outputs.
Each pipeline exposes
fit/transform/fit_transformand, when its steps are invertible,inverse_transform. Call them directly, e.g.recipe.features.transform(table)orrecipe.target.inverse_transform(prediction). Recipes do not infer each step’s non-finite input contract; order steps so values are imputed before processors that do not explicitly document non-finite support.- Parameters:
- property features: EnsembleProcessor#
The steps applied to model inputs.
- property target: EnsembleProcessor#
The steps applied to labels.
- property output: EnsembleProcessor#
The steps applied to model outputs.