Pipeline#
- class Pipeline(steps, breakpointers, pruners=None, once_in_iterations=1)[source]#
Bases:
BaseEstimatorAn estimator that fits a mixture model via a configurable iterative process.
The pipeline executes a sequence of defined steps in a loop. After each full sequence of steps, pruning strategies are applied, and stopping conditions are checked. The loop continues until a breakpointer signals to stop. This allows for building complex, multi-stage estimation algorithms, such as variants of the EM algorithm.
The core components used for configuration are:
- Parameters:
steps (Sequence[PipelineStep]) – An ordered sequence of steps to be executed in each iteration of the pipeline.
breakpointers (Sequence[Breakpointer]) – A sequence of strategies that define the stopping conditions for the iterative process. This list cannot be empty.
pruners (Sequence[Pruner] | None, optional) – A sequence of strategies for removing components from the mixture model during fitting. Defaults to None, meaning no pruning is performed.
once_in_iterations (int, optional) – The logging frequency. A value of n means logging occurs every n iterations. Defaults to 1 (log every iteration).
- Variables:
steps (list[PipelineStep]) – The ordered list of operations to be performed in each iteration.
breakpointers (list[Breakpointer]) – The list of objects that determine when the fitting process should terminate.
pruners (list[Pruner]) – The list of objects that may remove components from the mixture during the fitting process.
logger (IterationsHistory) – object that collects comprehensive information about each iteration of a
Pipelineestimator.
- Raises:
ValueError – If the sequence of
stepsis empty or invalid (i.e., a step is followed by a step not listed in itsavailable_next_steps), or if the sequence ofbreakpointersis empty.
Methods
fit(X, mixture)Fits the mixture model to the data using the configured pipeline.