TransformerPipelineElement#

class capymoa.stream.preprocessing.TransformerPipelineElement[source]#

Bases: PipelineElement

Pipeline element that wraps around a transformer

__init__(
transformer: Transformer,
)[source]#

Initializes the pipeline element with a transformer.

Parameters#

transformer: Transformer

The transformer associated with this pipeline element.

get_input_schema() → Schema | None[source]#

Return the schema the wrapped transformer expects to receive.

get_schema() → Schema | None[source]#

Return the schema of instances leaving the wrapped transformer.

pass_forward(
instance: Instance,
) → Instance[source]#

Transforms and returns the provided instance.

Parameters#

instance: Instance

The input instance

Returns#

instance: Instance

The transformed instance

pass_forward_predict(
instance: Instance,
prediction: Any = None,
) → tuple[Instance, Any][source]#

Transforms and returns the provided instance. Also returns the prediction that was provided.

Parameters#

instance: Instance

The input instance

prediction: Any

Most likely None, but could be anything.

Returns#

Tuple[Instance, Any]

The transformed instance and the prediction that was provided