pipeline module¶
A pipeline to chain transformers.
The Pipeline
class chains a sequence of tranformers, and provides global
fit(), transform(), fit_transform() and inverse_transform() methods.
- class gemseo.mlearning.transformers.pipeline.Pipeline(name='', transformers=None)[source]¶
Bases:
Transformer
Transformer pipeline.
- Parameters:
name (str) –
A name for this pipeline.
By default it is set to “”.
transformers (Sequence[Transformer] | None) – A sequence of transformers to be chained. The transformers are chained in the order of appearance in the list, i.e. the first transformer is applied first. If transformers is an empty list or None, then the pipeline transformer behaves like an identity transformer.
- duplicate()[source]¶
Duplicate the current object.
- Returns:
A deepcopy of the current instance.
- Return type:
- fit(data, *args)¶
Fit the transformer to the data.
- fit_transform(data, *args)¶
Fit the transformer to the data and transform the data.
- inverse_transform(data)[source]¶
Perform an inverse transform on the data.
The data is inverse transformed sequentially, starting with the last transformer in the list.
- transform(data)[source]¶
Transform the data.
The data is transformed sequentially, where the output of one transformer is the input of the next.
- property parameters: dict[str, bool | int | float | ndarray | str | None]¶
The parameters of the transformer.
- transformers: Sequence[Transformer]¶
The sequence of transformers.