PipelineState#

class PipelineState(X, H, prev_mixture, curr_mixture, error)[source]#

Bases: object

Represents the state of a pipeline at a specific point in its execution.

This dataclass is a mutable container that centralizes all information needed by the steps of a Pipeline. An instance of this class is created at the beginning of a pipeline run and is then passed sequentially through each step, which can modify it.

Parameters:
  • X (NDArray[float64]) – The input data sample. This data is typically treated as read-only throughout the pipeline’s execution.

  • H (NDArray[float64] | None) – The responsibility matrix (posterior probabilities). H[i, j] represents the probability that data point i belongs to component j. It may not be computed at every step.

  • prev_mixture (MixtureModel | None) – A snapshot of the mixture model from the previous iteration. This is useful for convergence checks, such as comparing log-likelihood values. It is None at the start of the pipeline.

  • curr_mixture (MixtureModel) – The current state of the mixture model that is being actively optimized by the pipeline steps.

  • error (Exception | None) – A container for any exception that occurs during a pipeline step. If a step encounters a non-fatal error, it can place an exception object here to signal the pipeline to terminate gracefully.