Pipeline#

class Pipeline(steps, breakpointers, pruners=None, once_in_iterations=1)[исходный код]#

Базовые классы: BaseEstimator

Iterative mixture model parameter estimator.

Sequentially executes configured processing steps, applies pruners, and checks stopping criteria on each iteration until convergence.

Steps and breakpointers may keep state between iterations. They are reused by every call of fit(), which calls PipelineStep.reset() and Breakpointer.reset() on each of them before the first iteration, so no per-fit state carries over between fits. Pruners are reused as is. history is not cleared between calls, so records of repeated fits accumulate.

Steps and pruners must replace state.curr_mixture with a new mixture object instead of modifying it in place, because prev_mixture and the history records hold references to it.

Параметры:
  • steps (Sequence[PipelineStep]) – Ordered sequence of steps executed in each iteration.

  • breakpointers (Sequence[Breakpointer]) – Stopping criteria defining termination conditions. Must not be empty.

  • pruners (Sequence[Pruner] | None, optional) – Component pruning strategies applied after step execution. Defaults to None.

  • once_in_iterations (int, optional) – Iteration snapshot recording frequency in history. Defaults to 1.

Переменные:
  • steps (list[PipelineStep]) – Ordered list of iteration steps.

  • breakpointers (list[Breakpointer]) – Configured stopping criteria.

  • pruners (list[Pruner]) – Configured component pruners.

  • history (IterationsHistory) – Recorded iteration snapshots.

Исключение:

ValueError – If steps is empty or cannot form a closed loop (each step, including the last transitioning to the first, must permit the next in available_next_steps), or if breakpointers is empty.

Methods

fit(X, mixture)

Fit mixture model parameters using the iterative pipeline.