ExpectationStep#
- class ExpectationStep(is_soft=True)[source]#
Bases:
PipelineStepA pipeline step that performs the Expectation (E-step).
This step calculates the responsibility matrix H, where H[i, j] is the posterior probability that the i-th data point belongs to the j-th mixture component. It can perform either a soft (probabilistic) or hard (winner-takes-all) assignment.
- Parameters:
is_soft (bool, optional) – If True (default), performs a soft assignment where H contains probabilities. If False, performs a hard assignment where each data point is assigned to the single most likely component (i.e., H contains only 0s and 1s).
- Variables:
is_soft (bool) – Flag indicating whether to perform soft or hard assignment.
Methods
run(state)Executes the E-step by calculating the responsibility matrix H.