remove_component#

MixtureModel.remove_component(component_idx)[source]#

Removes a component from the mixture by its index.

The weights of the remaining components are renormalized to sum to 1.

Parameters:

component_idx (int) – The index of the component to remove.

Raises:
  • IndexError – If the component index is out of range.

  • ValueError – If an attempt is made to remove the last component.